cancel
Showing results for
Did you mean:
Highlighted
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
Please let me know, where I am wrong in the formula?
1 ACCEPTED SOLUTION

Accepted Solutions
Super User III

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

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
2 REPLIES 2
Super User III

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

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
Frequent Visitor

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

@ Zubair_Muhammad, thank you it worked.

Announcements

#### 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?

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

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