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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
FireFireFire
Frequent Visitor

JOIN and UNION in Power BI? Better way than using conditional column?

I have two tables tblcalls and tblcallscc which stand in a 1:1 relationship via tblcalls.call_id and tblcallscc.cc_call_id. I want to merge them to one big table. Howevery, sometimes records are missing in one of the tables. And I also want to have a new column "id" that holds either tblcalls.call_id or tblcallscc.cc_call_id of whatever record exists.

 

Example:

union.PNG

 

This is what I would do in SQL to achieve this:

 

SELECT call_id as "id", * FROM tblcalls LEFT JOIN tblcallscc ON call_id = cc_call_id
UNION
SELECT cc_call_id as "id", * FROM tblcalls RIGHT JOIN tblcallscc ON call_id = cc_call_id  ORDER BY i

 

Now in Power BI I managed to do the UNION via "Merge Queries ->Merge Queries as New" and use a FULL OUTER JOIN. However, I am a bit lost how to efficiently add the "id" column.

 

Edit: I actually just found a way. What I did was to add a Conditional Column, but I would like to know if this is the way to do it, of if there is a better way.

 

add_column.PNG

1 ACCEPTED SOLUTION

then  I don't see any better method other than yours.

View solution in original post

3 REPLIES 3
Sunkari
Responsive Resident
Responsive Resident

Go for full outer join

Refer the below link for more details.

 

http://radacad.com/how-to-change-joining-types-in-power-bi-and-power-query

Sorry, I missed a word in my Question. I did use the FULL OUTER JOIN. My question was, if the way I added the "id" column  could be improved.

then  I don't see any better method other than yours.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.

Top Solution Authors