
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"
)
