To implement this recipe, do the following:
- Create the following measure:
MTBF (Hours) =
VAR __Table = 'R02_Table'
VAR __Table1 =
ADDCOLUMNS(
ADDCOLUMNS(
__Table,
"__Next",
MINX(
FILTER(__Table,
[MachineName] = EARLIER([MachineName]) &&
[RepairStarted] > EARLIER([RepairStarted]) &&
[RepairType] <> "PM"
),
[RepairStarted]
)
),
"__Uptime",
IF([RepairType] = "PM",
0,
IF(ISBLANK([__Next]),
DATEDIFF([RepairCompleted],NOW(),SECOND),
DATEDIFF([RepairCompleted],[__Next],SECOND)
)
)
)
VAR __TotalUptime = SUMX(__Table1,[__Uptime])
VAR __Repairs = COUNTROWS(FILTER(__Table,[RepairType] <> "PM"))
RETURN
DIVIDE(__TotalUptime,__Repairs,BLANK())/3600
- On a Report page, create a card visualization and place the MTBF (Hours) measure into the Fields area of the visualization.
- On the same Report page, create a table visualization and place the MachineName column as well as the MTBF (Hours) measure into the Values area of the visualization.
- On the same Report page, create a second table visualization and place the Cause column as well as the MTBF (Hours) measure into the Values area of the visualization.
The card visual provides a value for MTBF across all machines (MachineName) and all causes (Cause). The first table visualization demonstrates how MTBF can be analyzed to determine which machines are more reliable than others. Finally, the second table demonstrates that some causes of failure are more frequent than others.