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.
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_id | part_id |
1 | 1 |
1 | 2 |
2 | 1 |
55 | 99 |
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.
Solved! Go to 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,
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.
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
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,
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |