Forum Discussion

HamidBee's avatar
HamidBee
Power Participant
4 years ago
Solved

How do I create a conditional 'Colour Measure' for the 'value' column?

Hi All,   I have created a measure to say that if the 'value' is greater than 0 then the colour of the bar would be green and if it is less than 0 then the the colour of the bar would be red. I see...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi HamidBee ,

     

    You are creating measure, you will need to use SELECTEDVALUE() or SUM() function to capture the value from the visual.

    For example:

    color = SWITCH(TRUE(),SELECTEDVALUE('2021'[value])>0,"#006400",SELECTEDVALUE('2021'[value])<0,"#800020")

    Use SELECTEDVALUE() or SUM() or AVERAGE() depend on your needs.

     

    Best Regards,

    Jay