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?!

  • 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.

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for this. I have tried to use both the lookupvalue function and related but when I type in the column name for the data I am trying to pull from a different datatable the whole table doesnt show. Is is something to do with managing the relationships behind the data tables maybe?

  • 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.

  • AbbasG's avatar
    AbbasG
    Icon for Memorable Member rankMemorable Member

    Anonymous if you can share sample data/pbix file (after removing the sensitive information), it would be easy to help.