Forum Discussion
NickzNickz
3 years agoHelper IV
Measure return Inf
Hi ... I have below measure: Variance Projection =
VAR
_Nos = [Sum Achievement %] - [Sum Projection]
VAR
_percentage =
_Nos / [Sum Projection]
VAR
_direction =
...
- 3 years ago
You can use COALESCE to return 0 instead of blank,
Variance Projection = VAR _Achievement = [Sum Achievement %] VAR _Projection = [Sum Projection] VAR _Nos = _Achievement - _Projection VAR _percentage = COALESCE ( DIVIDE ( _Nos, _Projection ), 0 ) VAR _direction = SWITCH ( TRUE (), _Achievement >= _Projection, UNICHAR ( 9650 ), _Achievement < _Projection, UNICHAR ( 9660 ) ) RETURN _direction & " " & FORMAT ( _percentage, "0.00%" ) & " (" & FORMAT ( _Nos, "0.00" ) & ")"
johnt75
3 years agoSuper User
You can use COALESCE to return 0 instead of blank,
Variance Projection =
VAR _Achievement = [Sum Achievement %]
VAR _Projection = [Sum Projection]
VAR _Nos = _Achievement - _Projection
VAR _percentage =
COALESCE ( DIVIDE ( _Nos, _Projection ), 0 )
VAR _direction =
SWITCH (
TRUE (),
_Achievement >= _Projection, UNICHAR ( 9650 ),
_Achievement < _Projection, UNICHAR ( 9660 )
)
RETURN
_direction & " "
& FORMAT ( _percentage, "0.00%" ) & " ("
& FORMAT ( _Nos, "0.00" ) & ")"
- NickzNickz3 years agoHelper IV
It's working as expected. Thank you so much....