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

Create new table based on the comparison of values from two other tables

Hello,
I have following situation. I have table “1” and table “2”, see image.
How do I create table X which will include only Nr. form table “1” which has different description in table 2.

 

So the end result of data in table for the sample from the image would be:

Nr. from table1, Description from table 1, Description from table 2

90001, Name1, NameXVY

 

Since only the “90001” has different description in table “2”.

 Clipboard02.jpg

Thank you

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Create new table based on the comparison of values from two other tables

First you have to identify the Nr. who have a different Description. Therefore you merge your tables like this:

 

PBI_CreateNewTableComparisonTwoOthers_img1.png

 

Make sure that you've check both columns and select the "JoinKind.LeftAnti"-option.

This will return sth like this:

PBI_CreateNewTableComparisonTwoOthers_img2.png

 

Our table is selected to the correct rows, but the additional column can be ignored (as it is empty).

Next step will be to merge the 2nd table again with this new table, but this time not as a new one, but just in order to create new columns like this:

PBI_CreateNewTableComparisonTwoOthers_img3a.png

 

Choose the following options:

 

And expand:PBI_CreateNewTableComparisonTwoOthers_img3.png

PBI_CreateNewTableComparisonTwoOthers_img4.png

 

This should return what you're after.

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

2 REPLIES 2
Super User
Super User

Re: Create new table based on the comparison of values from two other tables

First you have to identify the Nr. who have a different Description. Therefore you merge your tables like this:

 

PBI_CreateNewTableComparisonTwoOthers_img1.png

 

Make sure that you've check both columns and select the "JoinKind.LeftAnti"-option.

This will return sth like this:

PBI_CreateNewTableComparisonTwoOthers_img2.png

 

Our table is selected to the correct rows, but the additional column can be ignored (as it is empty).

Next step will be to merge the 2nd table again with this new table, but this time not as a new one, but just in order to create new columns like this:

PBI_CreateNewTableComparisonTwoOthers_img3a.png

 

Choose the following options:

 

And expand:PBI_CreateNewTableComparisonTwoOthers_img3.png

PBI_CreateNewTableComparisonTwoOthers_img4.png

 

This should return what you're after.

If you liked my solution, please give it a thumbs up. An if I did answer your question, please mark my post as a solution. Thanks!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

skype_see4d Frequent Visitor
Frequent Visitor

Re: Create new table based on the comparison of values from two other tables

Thank you for your help. It worked like a charm. It took me a while to figure out that in first merge several columns are selected.

 

Br Matt

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)