cancel
Showing results for
Did you mean:
rtrohitsingh 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
Highlighted Super User

## 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%"
)
```
2 REPLIES 2
Highlighted Super User

## 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%"
)
```
rtrohitsingh Frequent Visitor

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

@ Zubair_Muhammad, thank you it worked.

Announcements #### 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. Learn the answers to some of the questions asked during the Amanda Triple A event. #### 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.  Top Kudoed Authors
Users Online
Currently online: 354 members 3,286 guests
Recent signins:
• adityakommu • JRS_PBI • AndreyBear • Sadapa07 • PoojaG • Ianverb • OPS-MLTSD • AsymIvane • Zahra_IG • klowrizer • Jferrell • n8ngrimm • maraprik 