March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I am trying to figure out a method for turning one row of data for a particular time frame into several rows for that same duration of time. The image shows an example of what I want to do. The first row in the green table should be split into the first 2 rows of the blue table and the second row of the green table should be split into the last 3 rows of the blue table. I have tried doing this with the List.Dates function and the Table.SelectRows function but the list dates function cannot convert my table into type date. I thought a loop might allow me to go row by row in my table and pull out the Start and End dates. Any assistance or ideas you can provide are welcomed. Thank you!
Solved! Go to Solution.
Before trying to do anything else, you should make sure the column is of type date (you can do this in the wizard under transform). Then, you can use something like this M code to get the rest of it done:
#"Added Custom" = Table.AddColumn(#"Changed Type", "Days", each Duration.Days([End] - [Start]) + 1),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom", each List.Dates([Start], [Days], #duration(1, 0, 0, 0))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom1", "Custom")
Before trying to do anything else, you should make sure the column is of type date (you can do this in the wizard under transform). Then, you can use something like this M code to get the rest of it done:
#"Added Custom" = Table.AddColumn(#"Changed Type", "Days", each Duration.Days([End] - [Start]) + 1),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom", each List.Dates([Start], [Days], #duration(1, 0, 0, 0))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom1", "Custom")
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |