Forum Discussion
HamidBee
4 years agoPower Participant
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...
- Anonymous4 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
Anonymous
4 years agoNot applicable
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
HamidBee
4 years agoPower Participant
Thank you for your answer. This is very clean and simple.