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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.