SWITCH DAX Function
The SWITCH 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:
• Expression: Any DAX expression that returns a single scalar value, where the expression is to be evaluated multiple times (for each row/context).
• Value: A constant value to be matched with the results of expression.
• Result: Any scalar expression to be evaluated if the results of expression match the corresponding value.
• Else: Any scalar expression to be evaluated if the result of expression doesn't match any of the value arguments.
Example: The following example creates a calculated column of month names.
DAX