Kpi visuals to show percentages

Hello. I know this is a simple solution but I’m stuck. But I want to show in the attached pbix file the percentage of VRU uptime (VRU = Vapor Recovery Unit). The VRU runs in Normal operation and then has alarms. I have % of grand total for the the VRU performance. I want to show as a KPI with a target value of 100% the Normal runtime amount. In the bar chart you can see it’s 91%. I want that in a KPI visual ike a dial gauge. I’ve done a COUNTROWS measure for the valuestring column which contains Normal and alarm in that column.

The measure I have is VRU % Uptime and the percentage show 975% which is wrong.

Measures:

Count of ValueString NORMAL =
CALCULATE(
COUNTROWS(‘PBFAlarmDetail’), ‘PBFAlarmDetail’[ValueString] = “NORMAL” , ALL( ‘PBFAlarmDetail’[ValueString]) )

Count of ValueString ALARM =
CALCULATE(
COUNTROWS(‘PBFAlarmDetail’), ‘PBFAlarmDetail’[ValueString] = “ALARM” , ALL( ‘PBFAlarmDetail’[ValueString]) )

VRU Uptime % =
DIVIDE( [Count of ValueString NORMAL], [Count of ValueString ALARM], 0)+0

Let me know if you have any questions. Thanks

VRU UPTIME DASHBOARD.pbix (2.9 MB)

@Paul.Gerber ,

Try this:

VRU Uptime % =
VAR Numerator = [Count of ValueString NORMAL]
VAR Denominator = [Count of ValueString ALARM] + [Count of ValueString NORMAL]
VAR Division = DIVIDE( Numerator, Denominator, 0 )
VAR Result = COALESCE( Division, 0 )
RETURN Result

image

Hope this is helpful.

  • Brian
1 Like

@BrianJ Genius. Now this is a new concept; COALESCE! Always learning something new. Thank you. I will let you know.

@Paul.Gerber ,

It’s just a little flashier way to say “if not blank then x else y”. Handy though.

  • Brian
1 Like

@Paul.Gerber ,

Great – glad to hear that worked well for you.

If you don’t mind, please start a new thread for the new question. Adding new questions/topics to a solved thread will often slow down a response to your question, since people looking for questions to answer will often skip over closed threads.

– Brian

1 Like