Cheat Sheets/Power BI/SWITCH
DAX function

SWITCHDAX 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

Related DAX functions

From Logical & error handling

Used in these tutorials

← Back to the Power BI (DAX) cheat sheet