Forum Discussion
sebastian62460
Sep 22, 2023Copper Contributor
Excel power query custom column
Hello I have this formula in custom power query column. I want to make a list of times in a 5 minutes interval. The start is in [Zaciatok Procedury] column and the end is in [Koniec Procedruy]. For e...
SergeiBaklan
Sep 23, 2023Diamond Contributor
If count number of intervals as Duration.TotalMinutes( Duration.From( [End]-[Start] ) )/5+1 it works as well.
All together
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
addPeriods = Table.AddColumn(
Source,
"List",
each List.Times(
Time.From( [Start] ),
Duration.TotalMinutes( Duration.From( [End]-[Start] ) )/5+1,
#duration(0,0,5,0))),
expandPeriods = Table.ExpandListColumn(addPeriods, "List")
in
expandPeriods