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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
JamesMcEwan
Helper I
Helper I

Pass through Record to Nested Table

I am looking to pass through the value of a record to a nested table within the same record, below is an example table where I am trying to pass through Name from the parent record into the nested table. I have also commented out the function I was trying to use. 

 

let
    Source =    
        Table.FromRecords(
            {
                [CustomerID = 1, Name = "Bob", Order = 
                    Table.FromRecords(
                        {
                            [TransactionID = 1, LineID = 1],
                            [TransactionID = 2, LineID = 2],
                            [TransactionID = 3, LineID = 3],
                            [TransactionID = 4, LineID = 4]
                        }
                    )                
                ],
                [CustomerID = 2, Name = "Jim", Order =  
                    Table.FromRecords(
                        {
                            [TransactionID = 5, LineID = 1],
                            [TransactionID = 6, LineID = 2],
                            [TransactionID = 7, LineID = 3],
                            [TransactionID = 8, LineID = 4]
                        }
                    )
                ]
              
            }
        )
   // CustomColumn = Table.AddColumn(Source, "Custom", each Table.AddColumn([Order],"Name",each _[Name]))
in
    Source
1 ACCEPTED SOLUTION
JamesMcEwan
Helper I
Helper I

Fount the Solution:

 

let
    Source =    
        Table.FromRecords(
            {
                [CustomerID = 1, Name = "Bob", Order = 
                    Table.FromRecords(
                        {
                            [TransactionID = 1, LineID = 1],
                            [TransactionID = 2, LineID = 2],
                            [TransactionID = 3, LineID = 3],
                            [TransactionID = 4, LineID = 4]
                        }
                    )                
                ],
                [CustomerID = 2, Name = "Jim", Order =  
                    Table.FromRecords(
                        {
                            [TransactionID = 5, LineID = 1],
                            [TransactionID = 6, LineID = 2],
                            [TransactionID = 7, LineID = 3],
                            [TransactionID = 8, LineID = 4]
                        }
                    )
                ]
              
            }
        ),
    CustomTable = 
        Table.AddColumn(Source, "Custom", 
                each 
                    let 
                        ParentName = [Name],
                        AddName = 
                            Table.AddColumn([Order],"
                                Name",
                                    each 
                                        ParentName
                            )
                    in 
                        AddName
            )
in
     CustomTable

View solution in original post

1 REPLY 1
JamesMcEwan
Helper I
Helper I

Fount the Solution:

 

let
    Source =    
        Table.FromRecords(
            {
                [CustomerID = 1, Name = "Bob", Order = 
                    Table.FromRecords(
                        {
                            [TransactionID = 1, LineID = 1],
                            [TransactionID = 2, LineID = 2],
                            [TransactionID = 3, LineID = 3],
                            [TransactionID = 4, LineID = 4]
                        }
                    )                
                ],
                [CustomerID = 2, Name = "Jim", Order =  
                    Table.FromRecords(
                        {
                            [TransactionID = 5, LineID = 1],
                            [TransactionID = 6, LineID = 2],
                            [TransactionID = 7, LineID = 3],
                            [TransactionID = 8, LineID = 4]
                        }
                    )
                ]
              
            }
        ),
    CustomTable = 
        Table.AddColumn(Source, "Custom", 
                each 
                    let 
                        ParentName = [Name],
                        AddName = 
                            Table.AddColumn([Order],"
                                Name",
                                    each 
                                        ParentName
                            )
                    in 
                        AddName
            )
in
     CustomTable

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.