0
0
Power BIbi_tool~5 mins

SWITCH function in Power BI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the SWITCH function do in Power BI?
The SWITCH function checks an expression against a list of values and returns the result corresponding to the first matching value. If no match is found, it can return a default value.
Click to reveal answer
beginner
Write the basic syntax of the SWITCH function.
SWITCH(<expression>, <value1>, <result1>, <value2>, <result2>, ..., [<default>])
Click to reveal answer
intermediate
How does SWITCH differ from nested IF statements?
SWITCH is easier to read and write when checking one expression against many values, while nested IFs can become complex and harder to manage.
Click to reveal answer
intermediate
Can SWITCH handle multiple conditions that are not based on a single expression?
No, SWITCH evaluates one expression and compares it to values. For multiple unrelated conditions, nested IF or other functions are better.
Click to reveal answer
beginner
What happens if no match is found and no default value is provided in SWITCH?
SWITCH returns BLANK() if no match is found and no default value is specified.
Click to reveal answer
What is the purpose of the SWITCH function in Power BI?
ATo compare one expression to multiple values and return a matching result
BTo sum values in a column
CTo filter rows based on a condition
DTo create relationships between tables
Which of the following is the correct syntax for SWITCH?
ASWITCH(result1, value1, expression, value2, result2)
BSWITCH(value1, expression, result1, value2, result2)
CSWITCH(expression, value1, result1, value2, result2, default)
DSWITCH(expression, result1, value1, result2, value2)
If SWITCH does not find a matching value and no default is given, what does it return?
AError
BBLANK()
CZero
DThe first result
Which scenario is best suited for SWITCH instead of nested IFs?
AChecking multiple unrelated conditions
BFiltering rows in a table
CSumming values in a column
DChecking one expression against many possible values
Can SWITCH evaluate multiple different expressions at once?
ANo, it evaluates only one expression
BOnly if nested inside IF
CYes, it can evaluate multiple expressions
DOnly with a default value
Explain how the SWITCH function works and when you would use it in Power BI.
Think about choosing from many options based on one question.
You got /5 concepts.
    Describe the difference between SWITCH and nested IF statements in DAX.
    Consider how easy it is to read and write each.
    You got /4 concepts.