Forum Discussion
PowerQuery | Duration more than 24 hours
- 8 years ago
Thanks for that note, I'll keep that in mind. Good thing I didn't convert it immediately I converted the data while it is in an unknow datatype state(text)
=(Date.Day([#"MyData"]) * 8640) + (Time.Hour([#"MyData"]) * 360) + (Time.Minute([#"MyData"]) * 60) + Time.Second([#"MyData"])
I basically converted to seconds!
- 8 years ago
Alternatively you can use:
= Duration.TotalSeconds([MyData] - #datetime(1899,12,31,0,0,0))
Notice that you will get wrong results from your solution for durations > 31 days, as the day number will become 1 for February 1, 1900. This is also the case when durations from Power Query are loaded into an Excel table.
You may be interested in this video:
Alternatively you can use:
= Duration.TotalSeconds([MyData] - #datetime(1899,12,31,0,0,0))
Notice that you will get wrong results from your solution for durations > 31 days, as the day number will become 1 for February 1, 1900. This is also the case when durations from Power Query are loaded into an Excel table.
You may be interested in this video:
I am confident that there will be no duration that will go beyond 28 days but I will definitely take your advise plus this one is better since it's OOTB!
I will have to change my solution then... Thank you, thank you!!!