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

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

Reply
CloudMonkey
Post Prodigy
Post Prodigy

Query editor: bring in value from related table

Hi,

 

I have some related tables:

 

Transaction Line Items -> Transactions -> Branch Details

 

I need to create a table in the query editor which includes all the rows from the table "Transaction Line Items" and a column from the "Branch Details" table.

 

I tried to use the "merge queries" tool but this requires two tables to be directly linked (with 2 columns that match), whereas in my situation there is an intermediary table "Transactions" in the relationship. Using query editor please can you tell me how to merge a column from the table "Branch Details" into the "Transaction Line Items" table?

 

Thanks,

 

CM

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

First merge Transaction with Branch Details.

Next, merge Transaction Item Lines with the result from the previous merge.

 

let
    Source = Table.NestedJoin(Transactions,{"Branch ID"},#"Branch Details",{"Branch ID"},"Branch Details",JoinKind.LeftOuter),
    #"Expanded Branch Details" = Table.ExpandTableColumn(Source, "Branch Details", {"Branch"}, {"Branch"}),
    #"Merged Queries" = Table.NestedJoin(#"Transaction Line Items",{"Transaction ID"},#"Expanded Branch Details",{"Transaction ID"},"Transaction",JoinKind.LeftOuter),
    #"Expanded Transaction" = Table.ExpandTableColumn(#"Merged Queries", "Transaction", {"Branch"}, {"Branch"})
in
    #"Expanded Transaction"
Specializing in Power Query Formula Language (M)

View solution in original post

1 REPLY 1
MarcelBeug
Community Champion
Community Champion

First merge Transaction with Branch Details.

Next, merge Transaction Item Lines with the result from the previous merge.

 

let
    Source = Table.NestedJoin(Transactions,{"Branch ID"},#"Branch Details",{"Branch ID"},"Branch Details",JoinKind.LeftOuter),
    #"Expanded Branch Details" = Table.ExpandTableColumn(Source, "Branch Details", {"Branch"}, {"Branch"}),
    #"Merged Queries" = Table.NestedJoin(#"Transaction Line Items",{"Transaction ID"},#"Expanded Branch Details",{"Transaction ID"},"Transaction",JoinKind.LeftOuter),
    #"Expanded Transaction" = Table.ExpandTableColumn(#"Merged Queries", "Transaction", {"Branch"}, {"Branch"})
in
    #"Expanded Transaction"
Specializing in Power Query Formula Language (M)

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.