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


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 Lewin 


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.





this is a new function for me, could you please help me with step by step? @Detlef Lewin 

Does any one have any solution for this?


What @Detlef Lewin suggested is to query source table by Power Query and made small transformation, generated script is looks like

    Source = Excel.CurrentWorkbook(){[Name="TableA"]}[Content],
    AddNo = Table.AddColumn(
        each List.Numbers(1,[NoOfTimes Sold])
    ExpandNo = Table.ExpandListColumn(
        AddNo, "No"
    RemoveUnused = Table.SelectColumns(
        {"Item", "No", "Unit price"}

and load result back into Excel sheet. It is in attached file.