Error Calculating %

HI,

I cant figure out why the measure for my utilization % is incorrect i feel every thing is right however the calculation doesn’t make sense?

Example the first calculation 5.25 Diveded by 8 * 100 = 62.625 not 367.87%

Strata Utilization.pbix (2.0 MB)

Thanks

Dan

1 Like

Hi @Krays23. I’d imagine as your not dividing numbers … when I open your sample I see date values (e.g., 30/12/1899) for your “Expected” and “Clocking” columns, which are both datetime; your sample screenshot shows hours and minutes (e.g., 8:00, 5:25). Try converting both values to an integer number of minutes before using DIVIDE; you should then see the desired result.
Greg

both of the measures that are used to calculate the Utilization % are returning a datetime value - even though you have formatted them to look like time values.

You will need to convert those in the Utilization measure in order to avoid having the measure trying to include the date in the calculation.

You will also need to decide how you are going to handle minutes - are they 60 parts of the hour, or 100 parts of the hour?

How to convert the values

If you are going to go with 60 parts of an hour (my preference):
HOUR( [COOIS Clocking 2] + ( MINUTE[COOIS Clocking 2] / 60 ) = 5.42

If you are going to go with 100 parts of an hour:
HOUR( [COOIS Clocking 2) + ( MINUTE[COOIS Clocking 2] / 100 ) = 5.25

NOTE: If you plan to use these measures in multiple calculations, you need to consider measures that will output to the proper format. Perhaps something like:

COOIS Clocking 2 (Time Only) formatting the logic as in one of the examples above, then you can just call this in any measures that need to use this value.

3 Likes

Or, you could just use @Greg’s much simpler solution :crazy_face:

1 Like

HI @dan,

Is below what you were looking for… You need to convert it to a single unit like I converted it to minutes. I see some numbers are too high compared to the Expected value like second row 23:27 against 8 so your % is very high.

UT% = 
DIVIDE( HOUR( [COOIS Clocking 2] ) *60 + MINUTE( [COOIS Clocking 2] ), HOUR( [Expected Hours & Minutes Inside] ) * 60 )

2 Likes

Superb thanks guys … Much love

1 Like