Categories: Data Analytics / Power BI
Tags:
emp payroll mgt power bi max maxx maxa

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 Active contains TRUE/FALSE, MAXA will return 1 if any employee is active, or 0 otherwise.

βœ… MAX would ignore TRUE/FALSE; MAXA treats 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)

FunctionWorks OnAccepts Expression?Handles TRUE/FALSEBest For
MAXSingle column❌ No❌ NoFinding max from numeric columns
MAXASingle column❌ Noβœ… YesMixed-type columns (e.g., TRUE/FALSE)
MAXXTable + expressionβœ… Yesβœ… If includedRow-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"
)