Forum Discussion

maku_'s avatar
maku_
Frequent Visitor
5 years ago
Solved

Conditional Formatting Isn't working for two instances

Hello,   I'd like to seek for your help with fixing the conditional formatting I created on a table I visualized.   What I have here are the following: a table showing "Amber" as the valu...
  • v-easonf-msft's avatar
    v-easonf-msft
    5 years ago

    Hi,  maku_ 

    Try formual as below:

    calculated column:

    color_flag = 
    SWITCH ( Growth_Data[Growth], "Green", 1, "Amber", 2, "Red", 3 )
    Classification = 
    VAR min_color =
        CALCULATE (
            MIN ( Growth_Data[color_flag] ),
            Growth_Data,
            Growth_Data[Logo_ID] = EARLIER ( Growth_Data[Logo_ID] )
        )
    RETURN
        SWITCH ( min_color, 1, "Green", 2, "Amber", 3, "Red" )

    Conditional formatting measure:

    New_Growth_Color =
    VAR Classification =
        SELECTEDVALUE ( 'Growth_Data'[Classification] )
    RETURN
        IF (
            Classification = "Green",
            "#35CE12",
            IF (
                Classification = "Amber",
                "#E1C233",
                IF ( Classification = "Red", "#FF0000", "#FF0000" )
            )
        )
    

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.