Evaluates an expression against a list of values and returns one of multiple possible result expressions.
SWITCH ( <expression>, <value>, <result>, [<value>, <result>] …, [<else>] )
|Sr.No.||Parameter & Description|
Any DAX expression that returns a single scalar value, where the expression is to be evaluated multiple times for each row/context.
A constant value to be matched with the results of expression.
Any scalar expression to be evaluated, if the results of expression match the corresponding value.
Any scalar expression to be evaluated, if the result of expression doesn't match any of the value arguments.
A scalar value coming from one of the result expressions, if there was a match with value, or from the else expression, if there was no match with any value.
All the result expressions and the else expression must be of the same data type.
= SWITCH ( [Week Day], 1, "Sunday", 2, "Monday", 3, "Tuesday", 4, "Wednesday", 5, "Thursday", 6, "Friday", 7, "Saturday", "Unknown" )
This DAX formula returns a calculated column with the names of the Week Day values.
26 Lectures 4.5 hours