02-16-2019 08:39 AM
This Quick Measure is an update to my Mean Time Between Failure (MTBF) measure that I developed in this article:
The original method had some significant column-based elements and my goal was to make this measure truly dynamic. A significant issue with the original approach is that when slicing by "Cause", the MTBF figure calculated was not truly dynamic by Cause of failure. In other words, the Uptime calculation did not account for only looking at particular causes, only between failures of the same machine. So, uptime calculated by considering all causes is vastly different than when only looking at a particular cause.
This measure corrects that flaw, although I have also included a version of the measure that does not need a calculated column but calculates uptime in the exact same way as in the aforementioned article. The new measures are down in the bottom, right-hand corner. You will notice that the new fully dynamic measure is much larger when selecting a Cause. This is because the MTBF calculation is only considering the MTBF for that particular cause.
MTBF (Hours) Measure = VAR __table = 'Repairs' VAR __table1 = ADDCOLUMNS(__table,"__next", MINX( FILTER(__table, [MachineName]=EARLIER([MachineName]) && [RepairStarted]>EARLIER([RepairStarted]) && [RepairType]<>"PM" ), [RepairStarted] ) ) VAR __table2 = ADDCOLUMNS(__table1,"__uptime", IF([RepairType]="PM", 0, IF(ISBLANK([__next]), DATEDIFF([RepairCompleted],NOW(),SECOND), DATEDIFF([RepairCompleted],[__next],SECOND) ) ) ) VAR __repairs = CALCULATE(COUNTROWS('Repairs'),FILTER(ALLSELECTED('Repairs'),[RepairType]<>"PM")) RETURN DIVIDE(SUMX(__table2,[__uptime]),__repairs,BLANK())/3600
Proud to be a Datanaut!