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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Switch (True().....) not showing the correct result

Hi Power BI Community,

I am creating a Dax formula with Switch (True()) case:

Nested If = SWITCH (TRUE (),
Data[Margine C] <= 0.00, "<=0%",
Data[Margine C] <=15.00, ">=0% <15%",
Data[Margine C] <=20.00, ">=15% <20%",
Data[Margine C] <=30.00, ">=20% <30%",
Data[Margine C] <=50.00, ">=30% <50%",
Data[Margine C] > 50.00, ">= 50%"
)
 
But when I am using this column in Slicer, it is showing me only Two value
power BI column.JPGnested if.JPG
Please let me know, where I am wrong in the formula?
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this one

 

Nested If =
SWITCH (
    TRUE (),
    Data[Margine C] <= 0.00, "<=0%",
    Data[Margine C] <= 0.15, ">=0% <15%",
    Data[Margine C] <= 0.20, ">=15% <20%",
    Data[Margine C] <= 0.30, ">=20% <30%",
    Data[Margine C] <= 0.50, ">=30% <50%",
    Data[Margine C] > 0.50, ">= 50%"
)

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this one

 

Nested If =
SWITCH (
    TRUE (),
    Data[Margine C] <= 0.00, "<=0%",
    Data[Margine C] <= 0.15, ">=0% <15%",
    Data[Margine C] <= 0.20, ">=15% <20%",
    Data[Margine C] <= 0.30, ">=20% <30%",
    Data[Margine C] <= 0.50, ">=30% <50%",
    Data[Margine C] > 0.50, ">= 50%"
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@ Zubair_Muhammad, thank you it worked.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors