cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Merge two tables - excluding rows that have the same value in one column

Hi, 

 

I was wondering if there is a way of merging two tables that would provide this result set. 

 

Table A: 

IDActivityCreation Time
11

11:00

2012:00
3013:00
4010:30
5011:00
6012:00

 

 

Table B: 

 

IDActivityCreation Time
23

12:00

729:00
8210:00
9210:30
10210:00
1128:00

 

 

I want to get back everything from Table B, plus everything in Table A EXCLUDING anything that has the same ID as something in Table B, so this is the data I want returned: 

 

IDActivityCreation Time
11

11:00

2312:00
3013:00
4010:30
5011:00
6012:00
729:00
8210:00
9210:30
10210:00
1128:00

 

Any suggestions? I've tried the Merge in Power Query and that doesn't allow a bespoke option. I was wondering if I need to do this as part of a union of the two tables? But cannot work out how to write this. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Merge two tables - excluding one column having the same value

Thank you @Mariusz, your answer helped me work out the correct answer. You need to do this to create a new table, then use a union to join the extra data you are missing in. Thanks

View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Merge two tables - excluding one column having the same value

Hi @annakentmuller 

 

You need to merge Join Kind   - Left Anti()
image.png

Remove the new column created from Table A

Next Append Both tables 
image.png

 

Please see the attached file for ref.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Highlighted
Frequent Visitor

Re: Merge two tables - excluding one column having the same value

Thank you @Mariusz, your answer helped me work out the correct answer. You need to do this to create a new table, then use a union to join the extra data you are missing in. Thanks

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Kudoed Authors