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
ChrisDiener
Regular Visitor

Merge Queries with multiple lookups

Hello.

I am wanting to create a merge query between two tables.

The column to lookup has one or multiple values which I want to return all values from the other table. e.g. I have on one row a column titled "Equipment" and the line has Equipment numbers 123, 527, 991.

I want to convert these equipment numbers to their correct name as defined on the other table.

How can this be done to create a new column using the merge query function to return Excavator, Truck, Aeroplane?

 2024-01-08_11-23-23.jpg

 

2024-01-08_11-27-21.jpg

2 ACCEPTED SOLUTIONS

Thank you Allison.

I am testing the option of Split Column by Delimiterm using each comma as an occurrence and split into rows.

It appears that all the information contained on that row duplicates when there are multiple Equipment entries, leaving only one Equipment item per row.

View solution in original post

Fowmy
Super User
Super User

@ChrisDiener 

On the Plant and Equipment - On Hire Query or copy of this query, right click on the Equipment column where you have the numbers seperated with comma, choose Split Column and on the dialog box, choose Rows under Advanced options, this will split the column into rows then you will be able to merge with the other table on the Equipment column:

Fowmy_0-1704692421406.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@ChrisDiener 

On the Plant and Equipment - On Hire Query or copy of this query, right click on the Equipment column where you have the numbers seperated with comma, choose Split Column and on the dialog box, choose Rows under Advanced options, this will split the column into rows then you will be able to merge with the other table on the Equipment column:

Fowmy_0-1704692421406.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you Ashish.

AllisonKennedy
Super User
Super User

@ChrisDiener I can't think of a way to do this without altering your model. You need a 'fact' table that details each equipment on the project, in this table, each row would only have 1 equipment ID. This 'fact equipment on project' table would connect to the project table, and also to the equipment table, using one to many relationships in each case. 

 

https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power.html

https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_11.html

https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Thank you Allison.

I am testing the option of Split Column by Delimiterm using each comma as an occurrence and split into rows.

It appears that all the information contained on that row duplicates when there are multiple Equipment entries, leaving only one Equipment item per row.

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.