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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
gadlakha
Frequent Visitor

Extract List of Records

Hey,

I have a data where in each row could have a list of records associated with it.
How can I extract each record from the list and add to the corrosponding row to be further expanded into each data value?

gadlakha_1-1683798905099.png

I need each row to have all corrosponding Module, GitReview, GitTag and PoC information for all the associated records from the list.

 

3 REPLIES 3
gadlakha
Frequent Visitor

Yes, but that created multiple rows for each KEY

Hi @gadlakha 

 

Give this a go. You can copy the full sample script below into a new blank query.

 

let
    Source = Table.FromColumns(
        {
            {1},
            {{[Module = "com", GitTag=2, Other = "text1"], [Module = "com", GitTag=3, Other = "text2"], [Module = "com", GitTag=4, Other = "text3"], [Module = "com", GitTag=5, Other = "text4"]}}
        },
        type table [ Key = number, Changes = list]
    ),
    ExtractRecords = List.Accumulate( Record.FieldNames( Source[Changes]{0}{0} ), Source,
        (s, a)=> Table.AddColumn( s, a, (x)=> Text.Combine( List.Transform( x[Changes], (y)=> Text.From( Record.Field( y, a ))), ", "), type text )
    )
in
    ExtractRecords

 

 

It returns the fieldnames from the first nested record in "Changes" list (you could replace this with a hard coded list of record field names you want to extract)

and adds a new column to show all values in a single cell.

m_dekorte_0-1683884820597.png

 

 Ps. If this helps solve your query please mark this post as Solution, thanks!

ppm1
Solution Sage
Solution Sage

Have you tried to expand that list (double arrow in column header) to new rows and then expand the Records column?

 

Pat

Microsoft Employee

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors