Forum Discussion
jitpbi
6 years agoPost Patron
Extract Hours
Hi, I am getting time deviation column from data source of type text which has values like: 0 days 01:10:00 0 days 00:20:30 1 days 02:10:00 I need to calculate hours from this columns,...
mahoneypat
6 years agoMicrosoft Employee
Please add a custom column in the query editor with this formula. It will give you the total hours, including partial/decimal hours.
= Number.From(Text.BeforeDelimiter([Column1], " "))*24 + Duration.TotalHours(Duration.FromText(Text.AfterDelimiter([Column1], " ", 1)))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat