Forum Discussion
Need help on how to create a VLOOKUP scenario using DAX
I am trying to replicate the same functionality of a VLOOKUP equation in Power BI.
Ex. So there are 2 spread sheets involved. One of the spreadsheets has a column that contains persons ID: "js100". The other spreadsheet, which is the orgnaization list, contains the person ID in a column (js100) and the persons name associated with the ID in another column (Jon Snow).
I need to create a DAX equation for a calculated column that will look at the persons ID (js100) from the first spread sheet then compare it to Organization list spreadsheet, find the same ID (js100), and then display the name(Jon Snow) associated with the ID. I would like the DAX calculated column in the first spreadsheet.
This is the vlookup equation from the excel: =IF(A2="","",VLOOKUP(L2,orglist!$A$1:$G$55,2,FALSE))
I know how to do the first part, which is seperate from the VLOOKUP: =IF(A2="","",VLOOKUP(L2,orglist!$A$1:$G$55,2,FALSE))
Please let me know if you need more detail and I appreciate all the help I can get.
LOOKUPVALUE ( ) should work for you I would imagine.
Something like the following code:
lookupName = LOOKUPVALUE( Table2[name], Table2[persons ID], Table1[persons ID] )
3 Replies
- AnonymousNot applicable
Hey wkelly1002
I made a quick video tutorial going over this method. The trick is to use the SEARCH function. Hopefully you will find it useful to your situation. Give it a watch!
https://www.youtube.com/watch?v=_bdHe3z_fVU
Thanks,
Parker
- ChrisMendoza
Resident Rockstar
LOOKUPVALUE ( ) should work for you I would imagine.
Something like the following code:
lookupName = LOOKUPVALUE( Table2[name], Table2[persons ID], Table1[persons ID] )- wkelly1002Frequent Visitor
That worked perfectly! Thank you!!