Forum Discussion

Fusilier2's avatar
Fusilier2
Helper V
1 year ago
Solved

KPI visual background colour conditional formatting based on changing value

So, I have a KPI card where the value for a department is measured against the total for the company for sickness days lost per FTE. Good is for the dept value to be below the company value. The KPI ...
  • rajendraongole1's avatar
    1 year ago

    Hi Fusilier2  - Yes! You can dynamically set the background color of your KPI card based on whether the department's value is above or below the company value by using conditional formatting with a measure.

     

    KPI_Background_Color =
    VAR DeptValue = SELECTEDVALUE('Sal1'[OrderID])
    VAR CompanyValue = SELECTEDVALUE('Sal1'[OrderID])

    RETURN
    IF(DeptValue < CompanyValue, "#C3E6CB",  // Green for good
       IF(DeptValue > CompanyValue, "#F8D7DA",  // Red for bad
          "#FFF3CD"))  // Yellow for neutral
     

     

    Hope this helps.

     

  • Fusilier2's avatar
    Fusilier2
    1 year ago

    Thank you very much!

    The people on this forum are so helpful.