Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional Formatting for visuals based off a specific field value

I've created conditional formatting for text and background colour in the past, super easy.  I'm trying to set a standard for the colour that will be used for a specific set of people that are listed...
  • az38's avatar
    6 years ago

    Hi Anonymous 

    as you use a measure you need select an exactly value to compare. e.g

    CSR_Colour =
    SWITCH(MAX('Query1 - Cases'[CSR_Number]),
    1, "EE9E64",
    2, "95DABB",
    3, "4A588A",
    "000000"
    )

     

  • Anonymous's avatar
    Anonymous
    6 years ago

    After a bit more trial and error, I was able to figure out a way to use the names and not create addition columns to classify the names to a number.  This method worked perfectly to let me use the visual conditional formatting to assign the colours properly by field value for any visual that has these values. 

     

    CSR_Colour =
    SWITCH(
    True(),
    Selectedvalue('Query1 - Cases'[Owner]) = "Eric", "#EE9E64",
    Selectedvalue('Query1 - Cases'[Owner]) = "Derek", "#95DABB",
    Selectedvalue('Query1 - Cases'[Owner]) = "Robert", "#4A588A",
    Selectedvalue('Query1 - Cases'[Owner]) = "Christine", "#73B761",
    Selectedvalue('Query1 - Cases'[Owner]) = "Jessica", "#75754f",
    "#000000"
    )