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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Saffira
New Member

SWITCH formula

Hi, I have a problem with the switch formula.

I would like to list different margin groups.

I have included a separate table in the query, namely:

Saffira_0-1690982031782.png

 


I have the following switch formula:

Saffira_1-1690982078424.png

 

The problem is that the categories are not caught properly. For example, in a table I see someone with a 10% margin still listed with the from 15% and above.
How can I solve this? Thanks in advance!

3 REPLIES 3
Saffira
New Member

Hi @rubayatyasmin,

 

Thank you for your reply.

 

I am quite new to Power BI and still have a lot to learn.

How do I check conditions from highest to lowest?

I do see that something goes wrong when I put it in an matrix. It looks like this:

Saffira_1-1691134586783.png

 

How can I fix this?

Thanks in advance!

 

@Saffira 

 

By try checking highest to lowest I meant to reverse your switch statements condition. Like write >15% first then <=10-15% then <= 8-10% and so on. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


rubayatyasmin
Community Champion
Community Champion

Hi, @Saffira 

 

try checking the conditions from highest to lowest. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.