Forum Discussion
KPI logic
- 5 years ago
Hi avanrijn2
I'm not sure what you really need. According to the sample data you provide, you can make some changes to your Measures.
KPI Status =
VAR threshold =
SELECTEDVALUE ( 'Table'[Target] )
RETURN
SWITCH ( TRUE (), [#Perc] > threshold, 1, [#Perc] <= threshold, 0 )
KPI Color =
VAR _red = "#FF0000"
VAR _green = "#00FF00"
VAR _kpistatus = [KPI Status]
VAR _color =
SWITCH ( _kpistatus, 1, _red, 0, _green )
RETURN
_color
The result looks like this:
For more details, you can refer the attached pbix.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi avanrijn2
I'm not sure what you really need. According to the sample data you provide, you can make some changes to your Measures.
KPI Status =
VAR threshold =
SELECTEDVALUE ( 'Table'[Target] )
RETURN
SWITCH ( TRUE (), [#Perc] > threshold, 1, [#Perc] <= threshold, 0 )
KPI Color =
VAR _red = "#FF0000"
VAR _green = "#00FF00"
VAR _kpistatus = [KPI Status]
VAR _color =
SWITCH ( _kpistatus, 1, _red, 0, _green )
RETURN
_color
The result looks like this:
For more details, you can refer the attached pbix.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.