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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Bajdak
Frequent Visitor

Duration between 2 dates with DirectQuery

Hello, 

 

i need to calculate the duration between two dates. It should be in time or number format.
It should be possible to visualize the average of the Duration.

Bajdak_0-1676549033231.png

In addition it should work with DirectQuery.

1 REPLY 1
marcelsmaglhaes
Super User
Super User

Hey @Bajdak 

 

You need to use the duration functions: Duration functions - PowerQuery M | Microsoft Learn

 

For example, to take the duration in days you can use:

 

=each Duration.Days([Date1] - [Date2])


If this posts helps, please mark my answer as a solution! 

Best Regards,
Marcel


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors