Forum Discussion
sakuraexcel
4 years agoNew Member
Combine multiple rows into one row within the same day
Hi,
I have a table generated from SQL that looks like this
| ts_start | ts_end | unit | Number | reason |
| 1/11/2021 0:00 | 1/11/2021 10:42 | X100 | 5000 | |
| 1/11/2021 10:42 | 2/11/2021 0:00 | X100 | 0 | X |
| 1/11/2021 0:00 | 1/11/2021 10:41 | X200 | 5000 | |
| 1/11/2021 10:41 | 2/11/2021 0:00 | X200 | 0 | X |
| 1/11/2021 0:00 | 1/11/2021 10:26 | X300 | 5000 | |
| 1/11/2021 10:26 | 2/11/2021 0:00 | X300 | 0 | X |
| 2/11/2021 0:00 | 3/11/2021 0:00 | X100 | 0 | X |
| 2/11/2021 0:00 | 2/11/2021 10:10 | X200 | 0 | X |
| 2/11/2021 10:10 | 2/11/2021 14:20 | X200 | 2500 | Y |
| 2/11/2021 14:20 | 3/11/2021 0:00 | X200 | 5000 | |
| 2/11/2021 0:00 | 3/11/2021 0:00 | X300 | 0 | X |
| 3/11/2021 0:00 | 4/11/2021 0:00 | X100 | 0 | X |
| 3/11/2021 0:00 | 4/11/2021 0:00 | X200 | 5000 | |
| 3/11/2021 0:00 | 3/11/2021 14:52 | X300 | 0 | X |
| 3/11/2021 14:52 | 3/11/2021 17:10 | X300 | 2500 | Y |
| 3/11/2021 17:10 | 4/11/2021 0:00 | X300 | 1000 | Y |
| 4/11/2021 0:00 | 5/11/2021 0:00 | X100 | 5000 | |
| 4/11/2021 0:00 | 5/11/2021 0:00 | X200 | 5000 | |
| 4/11/2021 0:00 | 5/11/2021 0:00 | X300 | 5000 |
Looking for solutions to combine multiple rows within the same day into a single row into something like below, is this doable using power query?
Thank you.
2 Replies
- wdx223_DanielCommunity Champion
- sakuraexcelNew Member
It works! Thanks a lot! 🙂