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
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
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.