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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Porkey
Frequent Visitor

Joining two tables but if column contains nulls join using another column for that row

I dont think this is possible, but i was wondering if it is, ive looked round but cant find an example of it being or not being possible

 

Merge 1 with 2

 

Table 1

Staff IDDepartment ID
1a
2c
nullb

 

Table 2

Staff IDDepatment IDLocation
1aScotland
2cWales
3bEngland

 

 

Outcome

Staff IDDepartment IDLocation
1aScotland
nullbEngland
2cWales

 

So because department B is in england it picks that up rather than where the staff id is based, I wouldnt want to use department ID as certain staff would not be located in the department location so would prefer to pick it up from Staff ID, but where thats missing from department ID instead

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @Porkey ,

Please try to use Right Outer join kind.

vpollymsft_0-1664247351186.png

 

Then remove the columns that you don't need.

vpollymsft_1-1664247466143.png

vpollymsft_2-1664247513672.png

 

Best Regards

Community Support Team _ Polly

 

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

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @Porkey ,

Please try to use Right Outer join kind.

vpollymsft_0-1664247351186.png

 

Then remove the columns that you don't need.

vpollymsft_1-1664247466143.png

vpollymsft_2-1664247513672.png

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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