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
TillerTechnical
Frequent Visitor

Run Hours difference between last entry date varied

G'day,

 

I have a feed of csv data that has running hours for multiple Assets & Components per Asset in same columns.

 

We need to trend hours per period over time for each component individually. The entries can be daily or odd periods.

 

I've tried to calculate the difference in multiple ways from some examples I have found, but this data being in list is a little trickier it seems. Appreciate any assistance or ideas of best Dax way.

 

Asset NameExternal NumberFinished DateItem Values ValueItem Values Component Name
Akuna 4MNT-0267710/11/20 7:1512711Engine - Main - PS
Akuna 4MNT-0267710/11/20 7:1512711Engine - Main - SB
Akuna 4MNT-0267710/11/20 7:152610Generator
PiparnMNT-0267610/11/20 6:014621Engine - Main
CloudbreakMNT-0267310/11/20 0:557105Engine - Main
Odyssey 1MNT-0267210/11/20 0:416976Engine - Main - PS
Odyssey 1MNT-0267210/11/20 0:416976Engine - Main - SB
Odyssey 1MNT-0267210/11/20 0:411307Generator
GundiriMNT-026719/11/20 23:34224Engine - Main
2 REPLIES 2
TillerTechnical
Frequent Visitor

Thank you @Greg_Deckler , much appreciated.

 

Your article is really useful for some future reference work. I found I couldn't get this one to work yet, but will persist as I'm sure it should. Likely some differences in the single column nature of this one.

 

Cheers

 

Drew

Greg_Deckler
Super User
Super User

@TillerTechnical See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
  __Current - __Previous


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.