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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JonathanJohns
Helper III
Helper III

Merge 2 tables with Power BI Desktop

Good afternoon everyone,

 

I am trying to merge two tables with Power BI but I don't find the way to do. 

 

The tables are from 2 Excel files. They have some similar columns but not all of them and they don't have the same number of columns.

 

For example, one is like that :

 

LotDateInd1Ind2Ind3
120/11/2017530200
221/11/2017636250
322/11/2017433225

 

And the other is like this one :

 ​

LotDate Ind1Ind2Ind3Ind4
120/11/201753050OK
221/11/201763655OK
322/11/201743360OK
423/11/201753055OK
524/11/201753560

NO

 

And I want to one table like this one :

 

LotDateInd1Ind2ind3Ind4ind5
120/11/201753020050OK
221/11/201763625055OK
322/11/201743322560OK
423/11/2017530 55OK
524/11/2017535 60NO

 

It's an example, in my case, one table has 170 columns and the other one 160 so the tables are so big that I cannot do it like before for each columns.

 

I have tried to do it on Excel directly with a function like vlookup() but it didn't work so I am trying with Power BI Desktop. 

 

Do you have any ideas to do it please ?

 

Cheers,

1 ACCEPTED SOLUTION

I used the function Add a new request in the Editor to do it. It is fast and it works properly ! 🙂

 

Thank you for your help.

 

Regards,

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @JonathanJohns,

 

Perhaps you can add a calculated column like:

Weigth = RELATED(Table1[Weigth])

You add the calculated column to the table you want to have this column in.

 

Let me know if this worked for you.

 

Regards,

L.Meijdam

Good morning,

 

I have tried with the two methods but I didn't succeed it. I did it by hand on Excel finally.

 

Thank you for your answers.

 

@JonathanJohns

 

In this scenario, you want to find the match Weight based multiple column values, so you should use LOOKUPVALUE() function. 

 

=
LOOKUPVALUE (
    Table2[Weight],
    Table2[Lot], Table1[Lot],
    Table2[Date], Table1[Date],
    Table2[pH], Table1[pH]
)

Regards,

I used the function Add a new request in the Editor to do it. It is fast and it works properly ! 🙂

 

Thank you for your help.

 

Regards,

Greg_Deckler
Super User
Super User

Several ways to do this. One, there is a Merge option in the Query Editor over on the far right of the ribbon.

 

Also, there is a NATURALINNERJOIN option in DAX:

 

https://msdn.microsoft.com/en-us/library/dn802543.aspx

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.