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

Conditional Formatting (Color Coding) based on a measure

Hello,

 

I'm trying to color-code the values in the matrix based on a measure that I created. Basically, if the value falls within the range of the measure (Calibration Range at the top) have a green background color, otherwise orange. I've been at it for days and still can figure it out. 

This is the formula for my measure (data type - Decimal number):

Calibration Range = FIXED((AssessmentHistory[Assessment Score]-(5)),2,1) & "%" & "-" & FIXED((AssessmentHistory[Assessment Score]+(5)),2,1) & "%"

 

ranghel_0-1690598549279.png

Moreover, the option to format style based on the Field value is not allowing me to pick a field.

 

ranghel_1-1690598647589.png

Thank you in advance for your time.

2 ACCEPTED SOLUTIONS

Hi @ranghel  you can create a dynamic measure for it based on your condition that will retunt true o false.

please refer to my answer including the sample file here :

https://community.fabric.microsoft.com/t5/Desktop/Conditional-formatting-with-measure-as-rule/m-p/33...


for more detailed answers I need some Pbix files to work with.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

technolog
Super User
Super User

You can fix it in 3 steps:

1. Set one color in the measure without any conditions

2. Set this measure for visualization
3. Set the right condition in the measure to calculate the color

 

technolog_0-1692740899670.png

 

technolog_1-1692740899671.png

 

p.s. Setting the measure type as "Text" has helped in the past, but that no longer works for me now

View solution in original post

4 REPLIES 4
technolog
Super User
Super User

You can fix it in 3 steps:

1. Set one color in the measure without any conditions

2. Set this measure for visualization
3. Set the right condition in the measure to calculate the color

 

technolog_0-1692740899670.png

 

technolog_1-1692740899671.png

 

p.s. Setting the measure type as "Text" has helped in the past, but that no longer works for me now

Ritaf1983
Super User
Super User

Hi @ranghel 
To format by measure try to select "rules "

Ritaf1983_0-1690600669875.png

 

 

Ritaf1983_1-1690600725192.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you @Ritaf1983. Unfortunately, it doesn't work because I don't have a fixed value to use in the rule. My values always change based on my slicer selection. 

Hi @ranghel  you can create a dynamic measure for it based on your condition that will retunt true o false.

please refer to my answer including the sample file here :

https://community.fabric.microsoft.com/t5/Desktop/Conditional-formatting-with-measure-as-rule/m-p/33...


for more detailed answers I need some Pbix files to work with.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.

Top Solution Authors