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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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