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