Match and Get the Value from another table (Vlookup)

Siddharth Thanga Mariappan picture Siddharth Thanga Mariappan · Jan 9, 2018 · Viewed 40.8k times · Source

I have 2 tables connected to each other through col A. I want to match the column C with Col A and get the value of Col B.

For Example,

Table 1

ColA    ColB     Colc
a        a1       b
a        b1       c
c        c1       a

Table2

ColA ColB
a     a1
b     b1
c     c1

Now, I have already created relationships between Table2 and Table1 for my other calculations connecting both the tables with the colA.

Now, I am trying to match ColC from Table1 with ColA of Table2 and return the value of ColB from Table2 as MatchedOutput.

Expected output Table1

 ColA    ColB     Colc     MatchedOutput
    a        a1       b     b1
    a        b1       c     c1
    c        c1       a     a1

Answer

Alexis Olson picture Alexis Olson · Jan 9, 2018

The DAX function for this is LOOKUPVALUE.

MatchedOutput = LOOKUPVALUE(Table2[ColB],Table2[ColA],Table1[ColC])

This looks for the value in Table2[ColB] where Table2[ColA] matches Table1[ColC].