Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Trying to calculate MTBF

here is my Data input:

DateTruckStatus
1-Jan1234-TTAActive
2-Jan1234-TTAActive
3-Jan1234-TTAActive
4-Jan1234-TTAActive
5-Jan1234-TTAActive
6-Jan1234-TTAOut of Service
7-Jan1234-TTAActive
8-Jan1234-TTAActive
9-Jan1234-TTAOut of Service
10-Jan1234-TTAOut of Service
11-Jan1234-TTAActive
12-Jan1234-TTAOut of Service
13-Jan1234-TTAActive
14-Jan1234-TTAActive
15-Jan1234-TTAActive
16-Jan1234-TTAOut of Service
17-Jan1234-TTAOut of Service
18-Jan1234-TTAActive
19-Jan1234-TTAActive
20-Jan1234-TTAOut of Service
21-Jan1234-TTAOut of Service
22-Jan1234-TTAOut of Service
23-Jan1234-TTAOut of Service
24-Jan1234-TTAActive
25-Jan1234-TTAOut of Service
26-Jan1234-TTAOut of Service
27-Jan1234-TTAActive
28-Jan1234-TTAOut of Service
29-Jan1234-TTAActive
30-Jan1234-TTAActive
31-Jan1234-TTAOut of Service

 

acording the the data number of breakdowns would be 8 and number of operational days would be 17

 

is there a DAX formula that would easily go through a list such as this generate these numbers for me

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Amazing thank you so much, only adjustment to the Formula would be subtracting 1 from the result

 

new column =
var _max = maxx(filter(Table, [Truck] = earlier([Truck]) && [Date] <earlier([date]) && [Status] ="Out of Service"),[Date])
return
if( [Status] ="Out of Service" && not(isblank(_max)), datediff(_max, [Date], day)-1)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , you can create a column like and use that for avg

 


new column =
var _max = maxx(filter(Table, [Truck] = earlier([Truck]) && [Date] <earlier([date]) && [Status] ="Out of Service"),[Date])
return
if( [Status] ="Out of Service" && not(isblank(_max)), datediff(_max, [Date], day))

Anonymous
Not applicable

Amazing thank you so much, only adjustment to the Formula would be subtracting 1 from the result

 

new column =
var _max = maxx(filter(Table, [Truck] = earlier([Truck]) && [Date] <earlier([date]) && [Status] ="Out of Service"),[Date])
return
if( [Status] ="Out of Service" && not(isblank(_max)), datediff(_max, [Date], day)-1)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.