March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |