Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Dear community,
I need to calculate the time difference between a column named "time_val" (formatted as date/time) as provided in the image below and "1/1/1970 0:00:00". The result should be provided in hours.
Input Data
So I created a new column and tried to calculate the time difference with the following expression:
duration = DATEDIFF(DateValue("1/1/1970"),SomeTable[time_val].[Date],HOUR)
Unfortunately, this only provides the duration in multiples of 24, so it basically seems to calculate the days and multiply the result with 24. What I would need, however, is the exact number of hours.
To give an example: For an entry "01.01.1970 14:20:00" I would expect a response of 14 (hours). What I get, however, is 0.
I'd highly appreciate any help.
Thanks and best regards
Oliver
Solved! Go to Solution.
Don't use the .date extension on the field. That invokes the hidden auto time intelligence date field. Try this.
duration = DATEDIFF(DateValue("1/1/1970"),SomeTable[time_val],HOUR)
Don't use the .date extension on the field. That invokes the hidden auto time intelligence date field. Try this.
duration = DATEDIFF(DateValue("1/1/1970"),SomeTable[time_val],HOUR)