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

Calculate difference between two date/time values

how can i find the diff bw two date/time columns.

 

col1                                          col2

 

9-4-2018 15:30:00             28-03-2018 21:00:00

2 REPLIES 2
v-jiascu-msft
Microsoft
Microsoft

Hi @Surya1,

 

In the data view, you can try the formula below.

Column = DATEDIFF([Column1], [Column2],HOUR)

Calculate_difference_between_two_datetime_values

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ChrisMendoza
Super User
Super User

 

 

@Surya1, in the Query Editor, try:

 

duration_calc = DateTime.From([Column2])-DateTime.From([Column1])

 

Returns

 

-11.77083333

 

-11.77083333 corresponds to:

Duration.Days([duration_calc])   =-11
Duration.Hours([duration_calc])  =-18
Duration.Minutes([duration_calc])=-30







Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!