How to get the duration between two datetime or date fields in Power BI

I had to do this recently and struggled a bit to begin with. Thankfully once I figured it out it was quite easy to accomplish, like most things, it’s always easy when you know how. Below is a view of the fields in question in Power Query:

What I wanted to get is the duration between the Closed date & the Created Date.

Step 1 First add a custom column (Go to Add Column > Custom Column)

Step 2 Change the data type to a Duration

Step 3 Go to Transform then Duration & choose the “Total” duration time that works best for you. As the time values in my fields where precise to the minute, then minute was good enough for me. 😊

Back to top