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
andreazambon
Helper V
Helper V

Advance conditional formatting with limits

Hi there. 

Suppose to have:

  • a measure used to calculate the material consuption of some row materials. 
  • a measure that calculates the inferior limit (min) for the theorical consumption;
  • a measure that calculates the major limit (max) for the theorical consumption.

All these information are shown in a table with the id of my materials.

In this scenario, we have a min-max range and a value for the actual consumption of my raw materials.

It's quite simple to put a measure to map the conditional formatting of a field: if the consumption is higher than the max -->green; if is lower than the min --> red.

 

What about a third rule applied if the value is inside the range? In this case i'd like to have a gradient from green to red.

Possible?

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

I do not think you are able to "stack" conditional formatting. In your case you may be able to get around this by using a measure that feeds into the custom values in the gradient formatting. 
As a small example, here is a list of numbers 1-20. I would like everything below my dynamic minimum value to be red, everything above my dynamic max value to be green and everything in between to be gradient.

I could write a measure as follows that accepts my min and max measures and assigns any value in my list that is below(equal) to the min as 0 and anything that is above(equal) to the max as 1. The measure then calculates a percentage of max value for the remaining values that will give the selected value a value between 0 and 1. You can then set the custom values of the gradient as 0 and 1.

jgeddes_0-1724335763769.png

jgeddes_1-1724335786506.pngjgeddes_2-1724335832067.png

 

jgeddes_3-1724335851102.png

This is a bit of a wonky workaround, but it might work for you.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
jgeddes
Super User
Super User

I do not think you are able to "stack" conditional formatting. In your case you may be able to get around this by using a measure that feeds into the custom values in the gradient formatting. 
As a small example, here is a list of numbers 1-20. I would like everything below my dynamic minimum value to be red, everything above my dynamic max value to be green and everything in between to be gradient.

I could write a measure as follows that accepts my min and max measures and assigns any value in my list that is below(equal) to the min as 0 and anything that is above(equal) to the max as 1. The measure then calculates a percentage of max value for the remaining values that will give the selected value a value between 0 and 1. You can then set the custom values of the gradient as 0 and 1.

jgeddes_0-1724335763769.png

jgeddes_1-1724335786506.pngjgeddes_2-1724335832067.png

 

jgeddes_3-1724335851102.png

This is a bit of a wonky workaround, but it might work for you.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.