Forum Discussion
Calculation Group - conditional formatting
- 1 year ago
Try rewriting your measure like this:
measure_color = VAR ChangeValue = [Count Forms Category] VAR Result = IF ( SELECTEDVALUE ( 'Calc Group'[name] ) IN { "MyCalcItem1", "MyCalcItem2" }, SWITCH ( TRUE, ChangeValue > 0, "#008000", ChangeValue < 0, "#FF0000" ) ) RETURN ResultThe concept is to wrap the logic in an IF statement that determines if a matrix column is one of the calculation items that needs formatting. The limitation of this approach is that you have to specify the measure name. SELECTEDMEASURE is a calculation item placeholder so it won't work in a measure. Here's a helpful video:
Try rewriting your measure like this:
measure_color =
VAR ChangeValue = [Count Forms Category]
VAR Result =
IF (
SELECTEDVALUE ( 'Calc Group'[name] ) IN { "MyCalcItem1", "MyCalcItem2" },
SWITCH ( TRUE, ChangeValue > 0, "#008000", ChangeValue < 0, "#FF0000" )
)
RETURN
Result
The concept is to wrap the logic in an IF statement that determines if a matrix column is one of the calculation items that needs formatting. The limitation of this approach is that you have to specify the measure name. SELECTEDMEASURE is a calculation item placeholder so it won't work in a measure. Here's a helpful video:
- cn44221 year agoHelper V
DataInsights Thank you very much - also for the Video, awesome stuff! ^^
I put in the following measure and it worked fine:One Measure Cond Format =IF(SELECTEDVALUE('CalcGroup'[Name]) IN {"Δ LY", "Δ LY in %"},[Count Forms Category],BLANK())- DataInsights1 year agoSuper User