Forum Discussion
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 Name | External Number | Finished Date | Item Values Value | Item Values Component Name |
| Akuna 4 | MNT-02677 | 10/11/20 7:15 | 12711 | Engine - Main - PS |
| Akuna 4 | MNT-02677 | 10/11/20 7:15 | 12711 | Engine - Main - SB |
| Akuna 4 | MNT-02677 | 10/11/20 7:15 | 2610 | Generator |
| Piparn | MNT-02676 | 10/11/20 6:01 | 4621 | Engine - Main |
| Cloudbreak | MNT-02673 | 10/11/20 0:55 | 7105 | Engine - Main |
| Odyssey 1 | MNT-02672 | 10/11/20 0:41 | 6976 | Engine - Main - PS |
| Odyssey 1 | MNT-02672 | 10/11/20 0:41 | 6976 | Engine - Main - SB |
| Odyssey 1 | MNT-02672 | 10/11/20 0:41 | 1307 | Generator |
| Gundiri | MNT-02671 | 9/11/20 23:34 | 224 | Engine - Main |
2 Replies
- Greg_DecklerCommunity 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/339586.
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 - TillerTechnicalFrequent 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