Forum Discussion
maku_
5 years agoFrequent Visitor
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...
- 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.
maku_
5 years agoFrequent Visitor
I've uploaded the data table. I can't upload a sample powerbi as the forum doesn't allow it.
Also, for the tweak, you made, it sorta works but not in a dynamic way as it will just pull the last entry
v-easonf-msft
5 years agoCommunity Support
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.