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...
Riny_van_Eekelen
Sep 23, 2023Platinum Contributor
Duration.Minutes doesn't calculate the number of minutes between the two times! It merely calculates the difference in the minute parts of the times. In your case, 30 - 5 = 25. When you expand the list produced with your code you will get a list of 25 times, starting at 9:05 and ending at 11:05 with 5 minute intervals.
To get the 17 times that you expect to get, try this code in stead:
List.Times(Time.From([Start]),(Number.From ([End])-Number.From ([Start]))/5*1440, #duration(0,0,5,0))
Example attached.