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
vyacheslavg
Helper II
Helper II

Help with data modeling (how to join two tables)

Hello colleagues, 

 

could you please help with a basic (fundamental) understanding of how joins work in the PBI (Power BI) data model.

 

I have two related tables - parts and assemblies, which consist of parts.

 

Parts table

 

part_id
1
2

33

 

Assemblies table

 

assembly_idpart_id
11
12
21
5599

 

I load and connect tables in Power BI, using part_id to define a relationship.

 

Then I create two very basic pivot tables for analysis:

1) to calculate the count of parts in assemblies and

2) the count of assemblies "in" parts.

 

I don't exactly understand the result I see, though. What I want to see is what was done in another (similar) BI software, but which uses full outer join (kind of, they use a different terminology for relationships) by default.

 

It looks, like Power BI uses only inner join to relate tables in the relationship screen? Is it possible to define left or right outer join in the relationship view? Or maybe DAX is required? I can't use the Power query or SQL or Pandas, where I can define the outer or negative joins -   because I need these datatables to be in a memory (RAM) for faster analysis.

 

 

 

 

 

 

Screenshot from another software, not PBIScreenshot from another software, not PBIScreenshot from PBIScreenshot from PBI

1 ACCEPTED SOLUTION

Hi @vyacheslavg 

I make a test as below

Sheet1

index1 id1 id2
1 1 1
2 2 1
3 1 2
4 55 99

 

Sheet2

index2 id3
1 1
2 1
3 2
4  
5 33

 

create a new table

Table = SUMMARIZE(NATURALLEFTOUTERJOIN(Sheet2,Sheet1),Sheet1[id1],Sheet1[id2],Sheet2[id3])

id1

id2

id3

1

1

1

2

1

1

1

2

2

55

99

 
   

33

 

Note, 

NATURALLEFTOUTERJOIN(Sheet2,Sheet1)
Sheet2->has 5 rows which the new table should have
Sheet1->has 4 rows
 
Best Regards
Maggie
 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
vyacheslavg
Helper II
Helper II

I guess, my question boils down to a very simple question - how to do a full outer join in DAX?

Power query does exactly what i need.

I've tried NATURALLEFTOUTERJOIN. No, this is a left outer join.

I've tried CROSSJOIN. No, this is a cartesian multiplication of tables.

I watched all Ruth/Curbal videos, related to joins - everything in Power Query - no problems.

But I can't figure out the full outer join in DAX Smiley Indifferent

 

 

 

Power query, full outer - the needed resultPower query, full outer - the needed result

Hi @vyacheslavg 

I make a test as below

Sheet1

index1 id1 id2
1 1 1
2 2 1
3 1 2
4 55 99

 

Sheet2

index2 id3
1 1
2 1
3 2
4  
5 33

 

create a new table

Table = SUMMARIZE(NATURALLEFTOUTERJOIN(Sheet2,Sheet1),Sheet1[id1],Sheet1[id2],Sheet2[id3])

id1

id2

id3

1

1

1

2

1

1

1

2

2

55

99

 
   

33

 

Note, 

NATURALLEFTOUTERJOIN(Sheet2,Sheet1)
Sheet2->has 5 rows which the new table should have
Sheet1->has 4 rows
 
Best Regards
Maggie
 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.