Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Conditionally format bar chart based on another field value

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 targ...
  • PhilipTreacy's avatar
    3 years ago

    Hi Anonymous 

     

    Download example PBIX file

     

    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