DAX function
SWITCH — DAX function reference
Match one value against many.
Syntax
dax
SWITCH(<expression>, <value1>, <result1> [, <value2>, <result2>, …], [<else>])
Examples
dax
SWITCH([Grade], "A", 4, "B", 3, 0)
→ The matched result
dax
SWITCH('Date'[MonthNumber], 1, "Jan", 2, "Feb", 3, "Mar", "Other")→ A month-abbreviation lookup without a separate table
dax
SWITCH([Region], "NA", "North America", "EMEA", "Europe, Middle East & Africa", "APAC", "Asia Pacific", "Other")
→ Expands region codes to full names
Common mistakes & gotchas
- SWITCH(expression, …) only tests exact equality against a single expression — it can't evaluate independent boolean conditions per branch; for that you need the SWITCH(TRUE()) pattern instead.
- If nothing matches and there’s no else/default argument, SWITCH returns BLANK() — always include a final catch-all unless a blank result is genuinely intended.
Related DAX functions
From Logical & error handling