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
Jason290
New Member

Need help merging two tables to bring over a column

 
7 REPLIES 7
dufoq3
Super User
Super User

Hi @Jason290, it is easy in power query using Merge Queries.

 

Merge Queries:

dufoq3_0-1713647191346.png

 

Expand System:

dufoq3_1-1713647203787.png

 

But be careful! At the beginning you have to remove duplicates from Table2:

dufoq3_3-1713647469175.png

 

If you don't delete duplicates in Table2, the result will be confusing:

dufoq3_4-1713647644000.png

 

Or you can add this as custom Column in Table1:

 

Text.Combine(Table.SelectRows(Table2, (x)=> x[ip address] = [ip address])[System], " | ")

 

Result:

dufoq3_5-1713647852951.png

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

I don't want to concatenate the system names, I want to show them in seperate rows, and I don't want to remove duplicates from table2 because two different system can have the same ip address. but as you can see after doing either left outter or inner merge you get duplicate ip addresses for the ones where there are matching ip addresses between two different systems in table2. But I want the matching ip's in table2 to show once for each systems after the merge like shown in the desired result table. 

OK, add this as custom column to Table1

 

Table.SelectRows(Table2, (x)=> x[ip address] = [ip address])

 

 

 and then expand System

dufoq3_1-1713649817421.png


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

That gives same result as a Left Outer join. which is not the desired result.

I don't understand what you need.

dufoq3_0-1713650861031.png

 

Expanded:

dufoq3_1-1713650900889.png

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Screenshot2.pngit's listed somewhere down line 25-26. do a filter to see firstMac, you will see 192.168.1.6 and 192.168.1.12 listed twice. Same for secondMac

Check attached pbix file.

 

I've added System Number to Table2 and sort via this column which is mandantory.

dufoq3_0-1713687953854.png

 

With this it is possible to achive expected result, but maybe you will need to sort also Table1

Let me know if this is what you want.

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

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.

Top Solution Authors
Top Kudoed Authors