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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
darrylwjk
Frequent Visitor

Looking up values from another table using a unique key M query

Hi,

I'm trying to get data from another table by mapping the Employee ID in the expenses table with the Username in the Employee data table. After mapping , I would like to get 4 columns Title , Function , Job Family and Job Title from the Employee Data and add it to the Expenses table.  Think of this whole process like a vlookup in excel just that I need to do it in M query to map and combine these columns from employee to expenses.

Expenses Table

darrylwjk_0-1671936032197.png

Employee Data Table

darrylwjk_1-1671936194860.png

 

I have tried using the merged queries function. I could get the columns in but the mapped data of Title , Function , Job Family and Job Title for each employee is wrong. So I'm not sure what is the best way to do this. Would appreciate the help thanks!

 

2 ACCEPTED SOLUTIONS
TomMartens
Super User
Super User

Hey @darrylwjk ,

 

using the Merge operation is the way to go, after the Merge you have to expand the table (the employee) table, if you keep the username then you can compare the values that have been used for the join.

You have to be aware that PowerQuery/M is capital sensitive, this is not the case for SSAS Tabular/DAX
For this reason I recommend that you transform the username in the employee table into all capital letters using the UPPERCASE transformation:
image.png
Hopefully, this provides what you are looking for.

 

Regards and Merry Christmas,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

Hi @TomMartens ,

Oh I see let me try these steps you have adviced thanks! It could be because I didn't convert the username to uppercase that's why the mapping values returned got messed up ...

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @darrylwjk ,

 

using the Merge operation is the way to go, after the Merge you have to expand the table (the employee) table, if you keep the username then you can compare the values that have been used for the join.

You have to be aware that PowerQuery/M is capital sensitive, this is not the case for SSAS Tabular/DAX
For this reason I recommend that you transform the username in the employee table into all capital letters using the UPPERCASE transformation:
image.png
Hopefully, this provides what you are looking for.

 

Regards and Merry Christmas,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens ,

Oh I see let me try these steps you have adviced thanks! It could be because I didn't convert the username to uppercase that's why the mapping values returned got messed up ...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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