To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello
I hope someone can help?
I want to create a list of datetimes between a Start DateTime column and an End DateTime column in Power Query with 1 hour between . I have tried this but it didn't work using add Custom Column
= List.DateTimes([#"Shift Start Time"], [#"Shift End Time"], #duration(0,1,0,0))
Example
Table currently looks like this
Start DateTime End DateTime
01/01/2020 00:00:00 01/01/2020 04:00:00
i want it to look like this
Start DateTime End DateTime Custom
01/01/2020 00:00:00 01/01/2020 04:00:00 01/01/2020 00:00:00
01/01/2020 00:00:00 01/01/2020 04:00:00 01/01/2020 01:00:00
01/01/2020 00:00:00 01/01/2020 04:00:00 01/01/2020 02:00:00
01/01/2020 00:00:00 01/01/2020 04:00:00 01/01/2020 03:00:00
01/01/2020 00:00:00 01/01/2020 04:00:00 01/01/2020 04:00:00
I have nearly no experience with M so it I would be grateful if I could get a statement to use to create a custom column
Thanks
Joe
Solved! Go to Solution.
@Anonymous
You may use code below to add a custom column.
List.DateTimes([Start DateTime], Duration.Hours([End DateTime] - [Start DateTime]) + 1, #duration(0,1,0,0))
@Anonymous
You may use code below to add a custom column.
List.DateTimes([Start DateTime], Duration.Hours([End DateTime] - [Start DateTime]) + 1, #duration(0,1,0,0))
Can you fix this so that it always end with the End Date and Time and the hours inbetweena are rounded to the end of the hour?