Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 56 | |
| 45 | |
| 35 | |
| 34 | |
| 21 |
| User | Count |
|---|---|
| 143 | |
| 122 | |
| 100 | |
| 80 | |
| 57 |