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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Community Champion
Community Champion

@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



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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