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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RICHARDCHIANG1
Frequent Visitor

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.