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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors