Forum Discussion
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
Employee Data Table
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!
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:
Hopefully, this provides what you are looking for.Regards and Merry Christmas,
Tom
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 ...
2 Replies
- TomMartens
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:
Hopefully, this provides what you are looking for.Regards and Merry Christmas,
Tom
- darrylwjkFrequent Visitor
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 ...