cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PBIn00b Regular Visitor
Regular Visitor

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

1 ACCEPTED SOLUTION

Accepted Solutions
PBIn00b Regular Visitor
Regular Visitor

Re: Using LOOKUPVALUE with the same columns more than once

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')

 

 

View solution in original post

3 REPLIES 3
kcantor Super Contributor
Super Contributor

Re: Using LOOKUPVALUE with the same columns more than once

I would recommend using the query editor to merge the queries.

https://www.lynda.com/Power-BI-tutorials/Merging-data/445425/477071-4.html



Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!




PBIn00b Regular Visitor
Regular Visitor

Re: Using LOOKUPVALUE with the same columns more than once

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 Regular Visitor
Regular Visitor

Re: Using LOOKUPVALUE with the same columns more than once

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')

 

 

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)