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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Neil_Cooper
Helper I
Helper I

If Statement based on % Measure

Hi Everyone

 

I wonder if I can ask for some help, basically I am looking to have a visual return a rating from 10-0 based on another measure which calculates as a percentage.

Whenever I attempt an if statement or lookup this does not seem to work so any suggestions will be massively appreciated!

 

In addition I am also looking to do this for a colour too in a second visual.

 

For example 

 

Neil_Cooper_0-1658135875285.png

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Neil_Cooper , This seems like a running total % , for that you need a unique column like the index column

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Rank with tie breaker can help

%  total = divide([Rank], count(allselected(Table)) )

 

Then you can have measure like

 

Switch( true(),

[% total] <= .05,  "Green",

[% total] <= .20,  "Yellow",

"Red"

)

 

You can use that in conditional formatting using field value option

 

Rank Tie breaker
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-...
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

Refer this for similar example

 

https://exceleratorbi.com.au/pareto-analysis-in-power-bi/

 

 

For color

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Neil_Cooper , This seems like a running total % , for that you need a unique column like the index column

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Rank with tie breaker can help

%  total = divide([Rank], count(allselected(Table)) )

 

Then you can have measure like

 

Switch( true(),

[% total] <= .05,  "Green",

[% total] <= .20,  "Yellow",

"Red"

)

 

You can use that in conditional formatting using field value option

 

Rank Tie breaker
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-...
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

Refer this for similar example

 

https://exceleratorbi.com.au/pareto-analysis-in-power-bi/

 

 

For color

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.