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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Calculate elapsed time between rows

I have a date/time column in my table.  I want a new column that will calculate the elapsed time in minutes between rows.  For example, the first row in the new column based on data in the screenshot below would be 30.  Row 2 would be 23.  Row 3 would be 7.  

 

How do I do this?  With DAX by adding a new column in the Excel data model?  Or by adding a Custom Column in Query Editor?  Either/or, I'd need the specific formula/statement spelled out for me to make it work.  

 

2019-07-26 11_53_19-GPS_L55500187 - Power Query Editor.png

Any help would be appreciated.  

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

you can use advice from @ImkeF  on how to reference previous row in M
https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-po...

then you can just subtract one column from another, set its type to duration and remove the previous date column



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

1 REPLY 1
Stachu
Community Champion
Community Champion

you can use advice from @ImkeF  on how to reference previous row in M
https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-po...

then you can just subtract one column from another, set its type to duration and remove the previous date column



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.