Forum Discussion

Joseph_Hchaime's avatar
Joseph_Hchaime
Helper III
3 years ago
Solved

Conditional Formatting on Cell based on two conditions

Hi   I have the below data example that I'm trying to apply conditional formatting on but I'm not able to do it. I tried creating two different rules but it didnt work.    Basically I want the sa...
  • parry2k's avatar
    3 years ago

    Joseph_Hchaime you can add a measure for the color and then use that in the conditional formatting:

     

    Color = 
    VAR __Amount = SUM ( Table[Amount] )
    VAR __Location = SELECTEDVALUE ( Table[Location] )
    RETURN
    SWITCH ( TRUE (),
       __Location = "NY" && __Amount >= 4000, "Green",
       __Location = "London" && __Amount >= 10000, "Red",
       __Location = "Dubai" && __Amount >= 6000, "Yellow"
    )