cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Foolke
Helper I
Helper I

Calculate time between 2 dates

All, all, all, all,
I have several date/time columns. Start_date, Mid_date, End date. In power query I want to calculate how much time there is between e.g. Start_date& Mid_date, Mid_date & end_date.
I thought the best way to do this was to use several extra columns in Power Query.
How do I do that?
Or do I do this better through a measure in PowerBi (DAX)?

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Foolke 

 

You can add a column like below.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @Foolke 

 

Can you create a data sample?

Yes, the easiest way would be to add extra columns in PQ.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

 

Data sample

TicketNrResolution_Actual_DateTimeBetweenSolved_Date
INC-44599629/01/2020 9:43 29/01/2020 9:43
INC-44748731/01/2020 15:23 31/01/2020 15:23
INC-45578729/01/2020 9:15 29/01/2020 9:15
INC-4626116/02/2020 21:30 6/02/2020 21:30
INC-46632631/01/2020 11:58 31/01/2020 11:58
INC-46662331/01/2020 13:03 31/01/2020 13:03
INC-4720847/02/2020 12:40 7/02/2020 12:40
Mariusz
Community Champion
Community Champion

Hi @Foolke 

 

You can add a column like below.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors