Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Conditional Formatting for Column Color based on different KPIs

I try to conditional format different sets of data simultaneously through a bar chart that navigates through different KPIs through a slicer, I want the column to be colored green if the value is gre...
  • SamWiseOwl's avatar
    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
        )