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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Derive value from previous recorded reading for specific ident

I would like to create a column that calculates the a value for the ammount of time run between two dates.

IE: (Total run time for ident aa19 on 09/01/2023) - (Total run time for ident aa19 on 02/01/2023)

 

I cannot get a figure which filters for both the required ident and the previous date recorded.

 

Any help appreciated.

 

Capture DateIdentTotal run timerun time since last capture
02/01/2023aa193332 
02/01/2023aa972033 
02/01/2023ab2113900 
02/01/2023ab203655 
09/01/2023aa193333 
09/01/2023aa972033 
09/01/2023ab2113907 
09/01/2023ab203655 
16/01/2023aa193335 
16/01/2023aa972048 
16/01/2023ab2113920 
16/01/2023ab203655 
23/01/2023aa193347 
23/01/2023aa972050 
23/01/2023ab2113929 
23/01/2023ab203659 
30/01/2023aa193352 
30/01/2023aa972050 
30/01/2023ab2113937 
30/01/2023ab203667 
06/02/2023aa193358 
06/02/2023aa972050 
06/02/2023ab2113951 
06/02/2023ab203673 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , if you need a new column

 

diff with Last Run =

_last = Maxx(filter(Table, [Ident] = earlier([Ident]) && [Capture Date] < earlier([Capture Date]) ),[Capture Date])

return

_last - Maxx(filter(Table, [Ident] = earlier([Ident]) && [Capture Date] = _last ),[Total Run])

 

 

if total run is measure then you need a measure

 

Diff Measure= [Total Run] - calculate([Total Run], OFFSET(-1, ALLSELECTED('Table'[Ident],'Table'[Capture Date]), ORDERBY('Table'[Capture Date],asc),KEEP,PARTITIONBY('Table'[Ident])))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

That worked great,

Thank you very much 👍

amitchandak
Super User
Super User

@Anonymous , if you need a new column

 

diff with Last Run =

_last = Maxx(filter(Table, [Ident] = earlier([Ident]) && [Capture Date] < earlier([Capture Date]) ),[Capture Date])

return

_last - Maxx(filter(Table, [Ident] = earlier([Ident]) && [Capture Date] = _last ),[Total Run])

 

 

if total run is measure then you need a measure

 

Diff Measure= [Total Run] - calculate([Total Run], OFFSET(-1, ALLSELECTED('Table'[Ident],'Table'[Capture Date]), ORDERBY('Table'[Capture Date],asc),KEEP,PARTITIONBY('Table'[Ident])))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.