cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.

Did I answer your question? Mark my post as a solution!

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.

Did I answer your question? Mark my post as a solution!

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
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 6 members 4,448 guests
Please welcome our newest community members: