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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OlegV
Helper II
Helper II

Left join two tables to one

Hi,

I have three tables: A,B,C.

 

A has a many-to-one relationship with B.

B has one-to-many relationship with C.

 

I need to left join B to A, and left join C to A.

 

Tables A and C do not have common columns.

I know how to join B to A. But I do not know how to join C to A.

 

ADDCOLUMNS (

A,

"JoinedB", related (B),

"JoinedC", ?)

 

Could you please help me?

In SQL the code would be sth like:

 

Select StockCode, Warehouse

From A as a

Left join B as b on a.StockCode=b.StockCode

Left join C as c on a."StockCode&Warehouse"=C."StockCode&Warehouse".

 

But in the PowerBi data model I am not allowed to create neither calculated table, nor calculated columns. I must use only existing relationships.

 

 

1 REPLY 1
ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?

 

have you tried to use merge query in PQ

Merge queries overview - Power Query | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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