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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors