Forum Discussion
Locco
5 years agoHelper III
Split rows based on quantity
I'm trying to split rows based on a quantity value. Each row has a quantity from 1-100. If the quantity is more than 1 I would like to split it into multiple rows. For instance if the quantity is...
PC2790
5 years agoCommunity Champion
You can try this:
1) Create a new custom column in Power Query Editor using the below formula:
= Table.AddColumn(#"Previous Step", "CustomCoumn", each List.Repeat({[Quantity]},[Quantity]))2) Now Expand to new rows as below:
I hope this will solve your purpose
Locco
5 years agoHelper III
That didn't work, all it did was copy the column. It did it copy rows though, where I had less than 100,000 rows I now have over 1 million. The Quantity doesn't show 1 though, it shows the value that is in "QUANTITY."