Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need help with a multicase SWITCH statement

The logic I am attempting to follow is:

  •  

 

If column 1 equals True then "Some Designation 1"

If column 2 equals True then "Some Designation 2"

If Column 3 equals "Some Value1" AND Column 4 equals 1 or 2 or 3 or 4 or 5 Then "Some Designation 3"

If Column 3 equals "Some Value2" AND Column 4 equals 1 or 2 or 3 or 4 or 5 Then "Some Designation 3"

Else "Undefined"

 

I cannot seem to get my SWITCH Correct:

Designation = SWITCH(
    TRUE(),
    'Table'[column1] = True, "Some Designation 1",
    'Table1'[Column2 = True, "Some Designation 2",
    'Table1'[column3] = "Some Value 1" 
    && 'Table1'[Column 4] = "1"||
        'Table1'[Column 4] = "2" || 
        'Table1'[Column 4] = "3" || 
        'Table1'[Column 4] = "4" || 
        'Table1'[Column 4] = "5" || 
        'Table1'[Column 4] = "6" || 
        'Table1'[Column 4] = "7" || 
        'Table1'[Column 4] = "8", 
        "Some Designation 3",
        'Table1'[column3] = "Some Value 2" 
    && 'Table1'[Column 4] = "1"||
        'Table1'[Column 4] = "2" || 
        'Table1'[Column 4] = "3" || 
        'Table1'[Column 4] = "4" || 
        'Table1'[Column 4] = "5" || 
        'Table1'[Column 4] = "6" || 
        'Table1'[Column 4] = "7" || 
        'Table1'[Column 4] = "8", 
        "Some Designation 3", 
        "Undefined")
1 REPLY 1
v-anabat
Microsoft Employee
Microsoft Employee

Hi, 

 

please check if the below formula works 

Result = SWITCH(TRUE(),
                'Table'[Column 1] = TRUE(), "Some Designation 1",
                'Table'[Column 2] = TRUE(), "Some Designation 2",
                'Table'[Column 3] IN {"1","2"} &&  'Table'[Column 4] IN {"1","2","3","4","5"}, "Some Designation 3",
                "Undefined"
)
sampledata.PNG
Based on your explination, I assumed data set/result as present in below sceenshot.
If it is different provide the same dataset

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.