Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Changing Text Colours Based On Value

Hi,    I have a data set which contains various columns that have "Yes" or "No" values. I have these columns displayed in a table and want the values to change colour.   If the value is "Yes" I w...
  • Pragati11's avatar
    6 years ago

    Hi Anonymous ,

     

    Your Dax expression doesn't look right. For RED or GREEN color you will have to use HEX COLOR CODES. This is what Power BI understands as colours.

     

    Try creating a measure using following dax:

    Colour Change =
    VAR Dept = SELECTEDVALUE('Safety Valve'[B A])
    RETURN 
    SWITCH( TRUE(),
    Dept = "Yes", "#FF0000",
    Dept = "No", "#008000"
    )
     
    You this measure as an conditional formatting in your table visual on your column which has got values YES/NO. 
    You can change the hex color codes as per your requirement.
     
    Thanks,
    Pragati