Forum Discussion
MTBF LTM Dax
Hello
I would like to do the MTBF of the last 12 months. To this end, I have made a measure with the following formulas.
mtbf =
var minutos= CALCULATE(SUM('MTTR Y MTBF'[Tiempo (min)]),DATESINPERIOD('Calendar'[Date], COALESCE(MAX('MTTR Y MTBF'[Fecha]),EOMONTH(MIN('Calendar'[Date]),-1)), -11, MONTH))
var tiempototal= CALCULATE(COUNTROWS('Calendar')*1440,DATESINPERIOD('Calendar'[Date], COALESCE(MAX('MTTR Y MTBF'[Fecha]),EOMONTH(MIN('Calendar'[Date]),-1)), -12, MONTH))
var intervenciones =(CALCULATE(COUNTROWS('MTTR Y MTBF'),DATESINPERIOD('Calendar'[Date], COALESCE(MAX('MTTR Y MTBF'[Fecha]),EOMONTH(MIN('Calendar'[Date]),-1)), -11, MONTH)))
var MTBF=IF(CALCULATE(COUNTROWS('MTTR Y MTBF'),DATESINPERIOD('Calendar'[Date], COALESCE(MAX('MTTR Y MTBF'[Fecha]),EOMONTH(MIN('Calendar'[Date]),-1)), -11, MONTH))>0, ((tiempototal-minutos)/intervenciones)/60/24)
MTBF RETuRN
The results are good for me, but the first year he does badly. This is because instead of starting to add the time from the incidence begins to count the twelve months before. I don't know how that data could be filtered, because I want to visualize it in an array. In addition, I have several sites and they all do not start on the same date.
Thank you very much in advance.
2 Replies
- amitchandak
Super User
Syndicate_Admin , In case you want avg to create measures like
CALCULATE(Averagex(Calendar[Month Year]), calculate(SUM('MTTR Y MTBF'[Tiempo (min)])) ) ,DATESINPERIOD('Calendar'[Date], COALESCE(MAX('MTTR Y MTBF'[Fecha]),EOMONTH(MIN('Calendar'[Date]),-1)), -11, MONTH))
You can have other calculation in the expression of averagex
- Syndicate_Admin
Administrator
Thank you very much for the answer, but calculating the avg does not help me with the problem I have