Forum Discussion
Fusilier2
1 year agoHelper V
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 ...
- 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])
RETURNIF(DeptValue < CompanyValue, "#C3E6CB", // Green for goodIF(DeptValue > CompanyValue, "#F8D7DA", // Red for bad"#FFF3CD")) // Yellow for neutralHope this helps.
- 1 year ago
Thank you very much!
The people on this forum are so helpful.
rajendraongole1
1 year agoSuper User
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.
- Fusilier21 year agoHelper V
Thank you very much!
The people on this forum are so helpful.