cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Super User III
Super User III

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%"
)
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Super User III
Super User III

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%"
)
Try my new Power BI game Cross the River

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
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors