Forum Discussion
tskumar
1 year agoRegular Visitor
Power Query automatically converting total hours into datetime format, hence Tot_Hrs are incorrect
I have data with total hours column but when i'm importing the data into power query automatically getting converted to datetime format and getting the sum of hours incorrect. Although I have disabl...
ZhangKun
1 year agoSuper User
It seems that my reply just now was not submitted?
Inside Excel, the date is still a number, but it will be displayed as a date. Power query will read this date(not number), and you may think of converting the Time (Hrs) column to number type, but this is wrong because the date system of Excel and Power query has some differences before 1900/3/1. The correct way is to use the date subtraction and convert it to a number, refer to the picture and code below.
Duration.TotalDays([#"time(Hrs)"] - #datetime(1899,12,31,0,0,0))