Forum Discussion
Conditional Formatting for Column Color based on different KPIs
- 1 year ago
Hi Anonymous
I've written this so you can make them all seperate tests if you want to using the individual switches.
Color Change MC Eff. =
VAR currMeasure =
SELECTEDVALUE ( 'KPI'[KPI] )
RETURN
SWITCH (
currMeasure,
"MC Efficiency (%)", SWITCH ( TRUE (), [MC Efficiency (%)] > [MC Efficiency T], "Green" ,"Red"),
"Weigher Efficiency (%)", SWITCH ( TRUE (), [Weigher Efficiency (%)] > [Weigher Efficiency T], "Green","Red" ),
"GGA", SWITCH ( TRUE (), [GGA (gm)] < [GGA T], "Green","Red" ),
"Film Waste (%)", SWITCH ( TRUE (), [Film Waste (%)] < 'Film Waste (%)'[Film Waste T], "Green","Red" ),
"R&M", "orange",
"Operating Supplies", "orange",
"Red" --If anything else
)
thanks Sam for your reply, however I pasted the code u provided and still there's some deviation from what's intended.
The GGA are all colored red and I modified the ">" to ">=" and still the values equal to the target are colored red (should be green)
I attached the file for u to review on google drive:
https://drive.google.com/drive/folders/13HYEo7dusjcHUzv7tT8pq5YXHcWR2d9G?usp=sharing
Hi Anonymous
The GGM needs to be GGM (gm) to match what it is in the slicer:
- Anonymous1 year agoNot applicable
that's great!! but still the greater than or equal has problems
it should be colored green as the target is 99.5% as well- SamWiseOwl1 year agoSuper User
Hmm my guess is somewhere the rounding is being a bit odd.
Make sure they are set to the same.
"Weigher Efficiency (%)", SWITCH ( TRUE (), FORMAT([Weigher Efficiency (%)],"0.00%") >= FORMAT([Weigher Efficiency T],"0.00%"), "green","red" ),Here I hardcoded the formatting but that is a bandaid on a bigger issue!