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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RishabhDhingra
New Member

Conditional Formatting based on Expressions

Hi All,

 

I have created a measure for Profit Alert which says if Profit is between ... and ... then "Ok", between .... and .... "Warning" else "Low". Now I have a bar chart against the Region dimension.

 

I would like to color the bar based on Profit Alert. However, when I place Profit Alert on Color Saturation I get diverging colors option. I was expecting to see three different colors for three different string values of Profit Alert.

 

Is this not possible to achieve in Power BI Desktop yet? If not, is there a workaround to achieve this?

 

Thanks,

Rishabh

3 REPLIES 3
konstantinos
Memorable Member
Memorable Member

I cannot think a way yet to add a dynamic measure specially when it returns text or segments.

 

You can achieve the 3 color scale ( if the Profit Alert is not dynamic - meaning the between values are static ) if you pass these values to the format pane. You add the profit measure also in the saturation field/place and the in the formatting options of the chart ( suppose a bar - column chart ) under Data colors you Select Diverging ON and then add manually the values and colors of Min, Center, Max. The first two Min, Center must be the same number or really close if you need distinc colors. You can play around with the limits. 

 

Untitled.png

 

Konstantinos Ioannou

@konstantinos, the method I usually use is to create a measure similar to what @RishabhDhingra has made, but returning -1, 0, 1 based on the conditions required. Then the diverging colors can be set for those numbers. This is very similar to the KPI implementation in SSAS and Power Pivot.

@greggyb Thanks..didn't thought that..This way can also be combined with dynamic target/limits..

Konstantinos Ioannou

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.