Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional Formatting Text Color in a Table

Hi   I have a column in a table visual which I want to color based upon the value. So the values are text and there are only three uniqe possiblities and i want to give each option a Green, Red or ...
  • jdbuchanan71's avatar
    6 years ago

    Anonymous 

    You need to write a measure to read the value of the cell then return the name of the color.

     

    Formatting = 
    VAR _Value = SELECTEDVALUE ( 'Table'[Value] )
    RETURN
    SWITCH (
        _Value,
        "West","Green",
        "Central","Gray",
        "East","Red"
    )

     

    You would change West, Central, East to match your values.

    Then you apply conditional formatting to the column > font color based on the Field value of the [Formatting] measure.

    I attached a sample file for you to take a look at.