Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Excel power query - combine list of records into single table

 

Hi,

I'm a newbie to Excel Power Queries (M language) and would appreciate some help. I have a table with a list of records called 'repTbl'. I wish to extract the contents of each record (2 records in the example below), and combine them into a single table.

 

Is there a way to do this efficiently using a loop or?

 

 let Source = Json.Document(Web.Contents(") aggregateByTradeLite = Source[aggregateByTradeLite], 
repTbl = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"reportResponse"}, {"Column1.reportResponse"}),


# loop 1 tmp = repTbl{0}[Column1.reportResponse], resetNotionalReport = tmp[resetNotionalReport], tmpTbl1 = Table.FromList(resetNotionalReport, Splitter.SplitByNothing(), null, null, ExtraValues.Error), tbl1 = Table.ExpandRecordColumn(tmpTbl1, "Column1", {}), # loop 2 tmp2 = repTbl{1}[Column1.reportResponse], resetNotionalReport2 = tmp2[resetNotionalReport], tmpTbl2 = Table.FromList(resetNotionalReport2, Splitter.SplitByNothing(), null, null, ExtraValues.Error), tbl2 = Table.ExpandRecordColumn(tmpTbl1, "Column1", {}), # combine tables from loops above combinedTable = Table.Combine({tbl1, tbl2}),

 

1 REPLY 1
wdx223_Daniel
Super User
Super User

 let Source = Json.Document(Web.Contents(") aggregateByTradeLite = Source[aggregateByTradeLite], 
repTbl = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"reportResponse"}, {"Column1.reportResponse"}),


Custom1=Table.TransformColumns(repTbl,{"Column1.reportResponse",each let resetNotionalReport=[resetNotionalReport], tmpTbl1 = Table.FromList(resetNotionalReport, Splitter.SplitByNothing(), null, null, ExtraValues.Error), tbl1 = Table.ExpandRecordColumn(tmpTbl1, "Column1", {}) in tbl1})
Custom2=Table.Combine(Custom1[Column1.reportResponse])
in Custom2

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.