Forum Discussion

PBIn00b's avatar
PBIn00b
Advocate II
10 years ago
Solved

Using LOOKUPVALUE with the same columns more than once

I am attempting to use LOOKUPVALUE to pull multiple columns of data from one table to another.  I am very familiar with using Excel VLOOKUP and INDEX MATCH, but I am new to using DAX.

 

I can get one LOOKUPVALUE formula to work fine, but when I attempt to create another, using the same data, I get a circular dependency error.

 

I have been told that I may need to use something like ALLEXCEPT, but I am not sure how that syntax would work.

 

Example formula:

 

1st Formula

LOOKUPVALUE('Table1'[Column2], 'Table1'[Column 1], 'Table2'[Column 1])

Returns Table1[Column2] Data

 

2nd Formula

LOOKUPVALUE('Table1'[Column3], 'Table1'[Column 1], 'Table2'[Column 1])

Returns a circular error

  • I reached out to Power BI support and they recommended I use the RELATED function.

     

    It looks like it worked!

     

    Create a relationship between the two tables, MANY to ONE

    Then Column = RELATED('Column from Related Table')

     

     

5 Replies

    • PBIn00b's avatar
      PBIn00b
      Advocate II

      Thank you for your response!

       

      One of the tables is a reference table with SKU information, the other is data is order data pulled from a system.  The pulled data would be a list of orders that would have a SKU column that looks like this:

       

      SKU 1

      SKU 1

      SKU 1

      SKU 3

      SKU 2

      SKU 3

      SKU 1

       

      I want to be able to look for each SKU in the reference table and pull information to the pulled data like description, etc...  I am not sure merging the queries would work in that case.  Then again, I am a PBI / DAX n00b.

      • PBIn00b's avatar
        PBIn00b
        Advocate II

        I reached out to Power BI support and they recommended I use the RELATED function.

         

        It looks like it worked!

         

        Create a relationship between the two tables, MANY to ONE

        Then Column = RELATED('Column from Related Table')

         

         

    • BIBen's avatar
      BIBen
      Helper I

      kcantor ,

      The link you posted is now broken. Can ytou post a new link that trains in that functionality?

       

      Thank you!!