Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Vlookup - cant find data table

Hi There,   I am trying to do what is a very easy vlookup in excel in Power BI but when I type in the formula bar it doesnt find the data table I am looking for, what have I done wrong?!
  • v-yanjiang-msft's avatar
    3 years ago

    Hi Anonymous ,

    RELATED function really need a relationship first, then columns in another table can be fetched in the formula.

    But LOOKUPVALUE function doesn't need a relationship. Usually if you want to fetch a column in Table2, you should create a calculated column in Table1 like this:

    LOOKUPVALUE('Table2'[Column2],'Table2'[Column1],'Table1'[Column1])

    I create a sample, you can refer to the steps to see if you missed something.

    Table1:

    Table2:

    The two tables don't have any relationship. Now I want to fetch the Cost column in Table1, create a calculated column in Table1:

    Column =
    LOOKUPVALUE ( Table2[Cost], 'Table2'[Category], 'Table1'[Category] )
    

    Result:

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.