
This is part 2 of DAX series on this project: Part 1 and Dataset is here : Employees-payroll-data-questions
π’ DAX MAX vs MAXA vs MAXX β Teaching with EmployeePayroll
π§© 1. MAX β Returns the maximum value from a single column
π Scenario: Whatβs the highest Monthly Income?
MaxIncome :=
MAX(EmployeePayroll[MonthlyIncome])
β
Output Example:MaxIncome = 9800 (if thatβs the highest in the column)
π§© 2. MAXA β Like MAX, but also evaluates TRUE as 1, FALSE as 0, and includes logical/text (if coerced)
π Scenario: Whatβs the maximum value in a logical column like Active?
MaxActive =
MAXA(EmployeePayroll[Active])
- If
ActivecontainsTRUE/FALSE,MAXAwill return1if any employee is active, or0otherwise.
β
MAXwould ignoreTRUE/FALSE;MAXAtreats them as numbers.
π§© 3. MAXX β Maximum from an expression across a table
π Scenario: Whatβs the maximum total salary (MonthlyIncome + Bonus) across employees?
MaxTotalEarnings :=
MAXX(
EmployeePayroll,
EmployeePayroll[MonthlyIncome] + EmployeePayroll[Bonus]
)
β
Output Example:MaxTotalEarnings = 10500 (if that’s the highest sum for any one employee)
π Summary Table (Teach this visually)
| Function | Works On | Accepts Expression? | Handles TRUE/FALSE | Best For |
|---|---|---|---|---|
MAX | Single column | β No | β No | Finding max from numeric columns |
MAXA | Single column | β No | β Yes | Mixed-type columns (e.g., TRUE/FALSE) |
MAXX | Table + expression | β Yes | β If included | Row-by-row max on calculated values |
π§ͺ Challenge Task for Students
π‘ βCalculate the maximum bonus given to employees in Department = ‘HR’.β
MaxBonus_HR :=
CALCULATE(
MAX(EmployeePayroll[Bonus]),
EmployeePayroll[Department] = "HR"
)
