Forum Discussion
How to expand table data in elaborated table (as shown in the attachment)
Hi Every one
Happy Chrismas and New Year in Advance
How to expand the table (Table A) based on no of sold and item. It should be shown in the same sequence in one column (Table B) itself?
6 Replies
- Sameer_Kuppanath_SultanBrass Contributor
Does any one have any solution for this?
- SergeiBaklanDiamond Contributor
What Detlef_Lewin suggested is to query source table by Power Query and made small transformation, generated script is looks like
let Source = Excel.CurrentWorkbook(){[Name="TableA"]}[Content], AddNo = Table.AddColumn( Source, "No", each List.Numbers(1,[NoOfTimes Sold]) ), ExpandNo = Table.ExpandListColumn( AddNo, "No" ), RemoveUnused = Table.SelectColumns( ExpandNo, {"Item", "No", "Unit price"} ) in RemoveUnused
and load result back into Excel sheet. It is in attached file.
- Detlef_LewinSilver Contributor
- Sameer_Kuppanath_SultanBrass Contributor
Hi,
Actually I want to list out unit price in the number mentioned in the no of sold.
For Eg:
Glassi Sold 8 Times. So i want to list out glassi price 8 times in the same column.
- Detlef_LewinSilver Contributor
Just to be clear: List.Numbers is a function within Power Query.
So you have to load the table into Power Query and add a custom column with containing this function.
See attached file.