Forum Discussion
mogugu_84
Helper I
1 year agoConditional formatting not working
The goal is to create a yellow/red coloring on the "3M G%" column in a matrix table comparing to the total at the bottom, i.e. if it's higher than the total (13.4%), it's yellow. i created th...
- 1 year ago
Hi mogugu_84
I'm thinking it's because you used text in your condition instead of a number which is how Rules are being evaluated. "1" is not 1. Also, please try to use this measure. Select Field Value from the conditional formatting options and use this measure.
3M G% Conditional Formatting = VAR _total = CALCULATE ( [3M G%], ALLSELECTED () ) -- Calculate the total 3M G% while considering all selected values in the filter context. -- This removes any specific row-level filters but still respects slicer selections. RETURN IF ( [3M G%] > _total, "#f6b53d", "#e85e76" ) -- Compare the current 3M G% value against the total. -- If the current value is greater than the total, return the color code "#f6b53d" -- Otherwise, return "#e85e76"
danextian
Super User
1 year agoHi mogugu_84
I'm thinking it's because you used text in your condition instead of a number which is how Rules are being evaluated. "1" is not 1. Also, please try to use this measure. Select Field Value from the conditional formatting options and use this measure.
3M G% Conditional Formatting =
VAR _total =
CALCULATE ( [3M G%], ALLSELECTED () )
-- Calculate the total 3M G% while considering all selected values in the filter context.
-- This removes any specific row-level filters but still respects slicer selections.
RETURN
IF ( [3M G%] > _total, "#f6b53d", "#e85e76" )
-- Compare the current 3M G% value against the total.
-- If the current value is greater than the total, return the color code "#f6b53d"
-- Otherwise, return "#e85e76"