Forum Discussion

Tevon713's avatar
Tevon713
Helper V
3 years ago

Conditional formatting within the measure

Hi all...

 

Got a simple ask if the difference between 2 data point is < then background color is red else green. I wish to do this all within the measure. Please see below sample.

 

VAR _diffFTECount = _FTECountCurrentYear - FTECountPreviousYear

VAR _result =
SWITCH (
SELECTEDVALUE ( 'Static'[Metrics] ),
"FTE Count", _diffFTECount < 0,"#ffc7ce","#c6efce",
)
RETURN
_result

2 Replies