Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Matrix conditional formatting (with Icons)

Hi all,

I conditional formatted my matrix such that the text color changes if it is above/below the overall average value. However, instead of different text color, I would like to show green and red circle icons next to the value instead. Could you advice on how I can change my measure below to achieve this? Thank you.

 

Current view:

Desired view:

Current measure:

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    I figured out that it can be done by simply using "CircleHigh" instead of "green" in the above formula. Then apply conditional formatting using "Icons" instead of "Font color"

     

    It then looks like this:

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks both.
    It seems like the suggestions provided so far require adding an icon by adding another field/measure. Is there a way to just alter the existing measure so that the icon appears next to my measure and in the same column?

    ColorFormat =
    var Freq_Overall = DIVIDE(
    CALCULATE(COUNTROWS(Sheet1),ALL(Sheet1[Clinic])),CALCULATE(DISTINCTCOUNT(Sheet1[Day]),ALL(Sheet1[Type],Sheet1[Color],Sheet1[Clinic])),0)
    return
    SWITCH(MAX(Sheet1[Type]),
    "Cat",IF(Sheet1[Freq per day]>Freq_Overall,"green",IF(Sheet1[Freq per day]=Freq_Overall,"black","red")),
    "Dog",IF(Sheet1[Freq per day]>Freq_Overall,"green",IF(Sheet1[Freq per day]=Freq_Overall,"black","red")))
    • Anonymous's avatar
      Anonymous
      Not applicable

      I figured out that it can be done by simply using "CircleHigh" instead of "green" in the above formula. Then apply conditional formatting using "Icons" instead of "Font color"

       

      It then looks like this: