Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
Does anyone have a way to conditionally format bar chart columns based on another fields value?
I would like the colours to be Red and Green based on whether the sum is greater than a target value.
The issue is the target values have changed over time and not static
Essentially i want to do;
If month value > target value = green
If month value < target value = red
I'm sure im missing an easy way to do this but i'm struggling!!
Solved! Go to Solution.
Hi @Anonymous
You need to create a measure that sets a color value based on the Target value, presumably this is a measure.
With that done, you can use the new color measure to set conditional formatting on the columns/bars
Measure to set color based on target value. I'm using Hex color codes, #0F0 is green, #F00 is red.
Column Color = IF(SUM('DataTable'[Value]) >= [Target], "#0F0", "#F00")
Then apply a CF rule
Regards
Phil
Proud to be a Super User!
Hi all,
Thanks for the discussion and the answer to this topic.
I'm currently trying to do a conditional formatting for a similiar use-case.
I have two bars in a clustered column chart, first is the achieved number, 2nd bar is the target number.
I would like to add the following conditional formatting: if the achieved number is smaller than the target number, the achieved number bar should be red. Otherwise, the achieved target number bar will be green.
Both bars should be visible in the clustered column chart.
I setup the measure which does exactly this:
If you can starrt a new topic and attach your PBIX file that'll make it easier to help you.
Regards
Phil
Proud to be a Super User!
Excellent, i new it would be a simple solution!
Hi @Anonymous
You need to create a measure that sets a color value based on the Target value, presumably this is a measure.
With that done, you can use the new color measure to set conditional formatting on the columns/bars
Measure to set color based on target value. I'm using Hex color codes, #0F0 is green, #F00 is red.
Column Color = IF(SUM('DataTable'[Value]) >= [Target], "#0F0", "#F00")
Then apply a CF rule
Regards
Phil
Proud to be a Super User!
Seems this answer was issued for Power BI version 1.9 or so, an seems not to be available in version 2.130 anymore (or it has been moved into another place?) So far I wasn't able to find it.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |