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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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%"
)

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%"
)
Anonymous
Not applicable

@ Zubair_Muhammad, thank you it worked.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors