Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |