Forum Discussion
Fusilier
1 year agoHelper III
Conditional colour formatting
Is it possible to create a conditional colour format based on % difference from a target value to change the background colour of a card visual? For example if a value is 50% higher than target show...
- 1 year ago
Hi Fusilier
Create a measure similar to below:
VAR _target = [target measure or target value] VAR _actual = [actual measure] VAR _diff = _actual - _target VAR _pct = DIVIDE ( _diff, _target ) RETURN SWITCH ( TRUE (), _pct > 0.5, "green", "red" )Use this to conditionally format a card's background using field value
danextian
1 year agoSuper User
Hi Fusilier
Create a measure similar to below:
VAR _target = [target measure or target value]
VAR _actual = [actual measure]
VAR _diff = _actual - _target
VAR _pct =
DIVIDE ( _diff, _target )
RETURN
SWITCH ( TRUE (), _pct > 0.5, "green", "red" )
Use this to conditionally format a card's background using field value
Fusilier2
1 year agoHelper V
How would you adapt this measure to show green if >target, red if < target or yellow if equal to target?