cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rtrohitsingh Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Highlighted
Super User
Super User

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

@rtrohitsingh 

 

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
Highlighted
Super User
Super User

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

@rtrohitsingh 

 

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

rtrohitsingh Frequent Visitor
Frequent Visitor

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

@ Zubair_Muhammad, thank you it worked.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 354 members 3,286 guests
Please welcome our newest community members: