Hi @Ackrite55,
I extracted the parentheses from the DateList column, split this column by delimiter, added a duration value and then passed that through Duration.TotalDays and Duration.TotalHours.
Here’s what the full Query looks like now:
let
Source = Excel.Workbook(File.Contents(FileLocation), null, true),
Time3_Table = Source{[Item="Time3",Kind="Table"]}[Data],
#"Confirm Text Format List" = Table.TransformColumnTypes(Time3_Table,{{"Name", type text}, {"Begin", type any}, {"End", type any}, {"DateList", type text}, {"TimeList", type text}, {"Avg. Duration", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Confirm Text Format List","(","",Replacer.ReplaceText,{"DateList", "TimeList"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",")","",Replacer.ReplaceText,{"DateList", "TimeList"}),
#"Split Column by Delimiter" = Table.SplitColumn(#"Replaced Value1", "DateList", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"DateList.1", "DateList.2", "DateList.3", "DateList.4"}),
#"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"DateList.1", Int64.Type}, {"DateList.2", Int64.Type}, {"DateList.3", Int64.Type}, {"DateList.4", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Duration", each #duration([DateList.1],[DateList.2],[DateList.3],[DateList.4])),
#"Inserted Total Days" = Table.AddColumn(#"Added Custom", "Total Days", each Duration.TotalDays([Duration]), type number),
#"Inserted Total Hours" = Table.AddColumn(#"Inserted Total Days", "Total Hours", each Duration.TotalHours([Duration]), type number),
#"Removed Other Columns" = Table.SelectColumns(#"Inserted Total Hours",{"Name", "Begin", "End", "TimeList", "Avg. Duration", "Duration", "Total Days", "Total Hours"})
in
#"Removed Other Columns"
and this is the result:
I hope this is helpful. Note. If you change the FileLocation parameter the query will be restored.
SubDatetime.pbix (12.8 KB)