SWITCH DAX Function in Power BI

The SWITCH DAX function evaluates an expression against a list of values and returns one of multiple possible result expressions.

DAX Syntax SWITCH(Expression, Value1, Result1[, Value2, Result2]…[,Else])

The function has the following parameters:

Example: The following example creates a calculated column of month names.

DAX

Month name = 
SWITCH(
    MONTH(Sheet1[Dates]),
    1, "January",
    2, "February",
    3, "March",
    4, "April",
    5, "May",
    6, "June",
    7, "July",
    8, "August",
    9, "September",
    10, "October",
    11, "November",
    12, "December",
    "Unknown month number"
) 

The output of the above code is shown below:

SWITCH dax function in Power BI