cancel
Showing results for 
Search instead for 
Did you mean: 

Mean Time Between Failure (MTBF)

Super User
449 Views
Super User
Super User

Mean Time Between Failure (MTBF)

This Quick Measure is an update to my Mean Time Between Failure (MTBF) measure that I developed in this article:

https://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339...

 

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

 

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!