Forum Discussion
sathyaramesh
Advocate II
6 years agoCalculate hours between two date/time column
Hi
I have a two calculated column
Col1 Col2
27-12-2019 04:35:00 28-12-2019 05:24:00
Need to calculate hours between col2-col1
Both column have date/time datatype
I need a total hours between the date.
Thanks in advance
I have a two calculated column
Col1 Col2
27-12-2019 04:35:00 28-12-2019 05:24:00
Need to calculate hours between col2-col1
Both column have date/time datatype
I need a total hours between the date.
Thanks in advance
21 Replies
- Ashish_Mathur
Super User
Hi,
Try this calculated column formula
=Data[Col2]-Data[Col1]
Format this column as Date/Time.
Hope this helps.
- sathyaramesh
Advocate II
Hi
I need total hours between the two column
Thanks- Ashish_Mathur
Super User
Hi,
This calculated column formula works
=DATEDIFF([Col1],[Col2],MINUTE)/60
Hope this helps.
- v-gizhi-msft
Community Support
Hi,
Please try this calculated column, and this can easily reach your requirement:
Total Hour = DATEDIFF('Table'[Col 1],'Table'[Col 2],SECOND)/3600The result shows:
If my answer has solved your issue, please mark it as a solution for others to see.
Thanks!
Best Regards,
Giotto Zhi
- Greg_Deckler
Community Champion
Column = DATEDIFF([Col1],[Col2],HOURS)- sathyaramesh
Advocate II
Hi
I tried but i have a date/time column
If i use that formula i am getting 0 for all rows
Is there any other way to calculate?
Thanks