Forum Discussion
one row to many rows
- 8 years ago
Hey,
I'm sorry for the late response.
Here is my solution for your requirement.
Starting with some sample data that looks like this:
In Powerquery I add a custom column using this simple formula:
{1..[no of months]}The curly braces in M the Powerquery language enclose/define a list, the list that will be dfined here starts with the integer value 1 and ends with value from the [no of months] the 2 dots .. indicate that a range will be created.
After applying the formual above, the result should look like this:
Now the function "Expand to new rows" can be used and the "final result" will look like this:
Hopefully this is what you are looking for
Regards
Tom
Hi Tom, thanks for that reply.. actually that's what i have right now. So:
ID Avg hours #months
1 100 5
2 50 2
3 300 6
Etc.
But what i need for an output is what I have in the original question.
Hey,
I'm sorry for the late response.
Here is my solution for your requirement.
Starting with some sample data that looks like this:
In Powerquery I add a custom column using this simple formula:
{1..[no of months]}The curly braces in M the Powerquery language enclose/define a list, the list that will be dfined here starts with the integer value 1 and ends with value from the [no of months] the 2 dots .. indicate that a range will be created.
After applying the formual above, the result should look like this:
Now the function "Expand to new rows" can be used and the "final result" will look like this:
Hopefully this is what you are looking for
Regards
Tom
- celebrindal8 years agoFrequent Visitor
Thanks Tom, did the trick.