Forum Discussion
Conditionally format bar chart based on another field value
- 3 years ago
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
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:
- PhilipTreacy2 years agoSuper User
If you can starrt a new topic and attach your PBIX file that'll make it easier to help you.
Regards
Phil