Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Lookupvalue value error

Hello everyone, I was hoping you could help me out. I was trying to do a look up function, but I was getting an error because it has duplicate values. I figured I would try this Calculate but it didn’t return what I was looking for, can someone help me?

 

I wanted to take the value from 'FedEx Query'[Shipper Reference] and match it with the same number in 'DLX Report Query'[PALLET_ID] so that I could get the Dealer code value from 'DLX Report Query'[Dealer Code] which has duplicates, but it can just grab the first one.

 

I originally tried this and got an error for multiple values: Dealer Code/DLX = LOOKUPVALUE('DLX Report Query'[Dealer Code], 'DLX Report Query'[PALLET_ID], 'FedEx Query'[Shipper Reference])

 

Then I tried this and could get it to work: Dealer Code DLX 3 = CALCULATE(FIRSTNONBLANKVALUE('DLX Report Query'[Dealer Code],1),FILTER(ALL('DLX Report Query'), 'DLX Report Query'[PALLET_ID] ='FedEx Query'[Shipper Reference]))

Look up errorLook up errorCalculateCalculate

7 REPLIES 7
ryan_mayu
Super User
Super User

@Anonymous 

how do you define 'grab the first one'? by date?

i create a simple sample data for testing

1.PNG

try to create a column

Column = 
MAXX(FILTER(TableA,TableA[orderid]=TableB[orderid]&&'TableA'[date]=MINX(FILTER(TableA,TableA[orderid]=TableB[orderid]),'TableA'[date])),TableA[value])

2.PNG





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

Proud to be a Super User!




nandic
Super User
Super User

@Anonymous ,
Try adding additional column in Table2:

Column = CALCULATE( FIRSTNONBLANK(Table2[Mark], Table2[Mark]), ALLEXCEPT(Table2, Table2[Id] ) )
-- Mark is value that i wanted to return in Table1, but there are different marks for same Id. 
-- So i added new column which returns always same Mark for same Id (first occurence)

Now when i return to Table1 where i want to add lookupvalue, i will not search by Table2[Mark], but by my new column which has unique values per Id.
Lookup formula: 
Lookup column = LOOKUPVALUE(Table2[Column],Table2[Id],Table1[Order Number])



Anonymous
Not applicable

DLX Report Table.png

FedEx Query Table.png

So I tried to do that and it didn't change any thing.

@Anonymous ,

I checked your screenshots.
Second image means that there is no unique value for parameters that you use in lookupvalue function. It means that you should add some more parameters which will return unique value.
First image, the logic is to return max value per some criteria. Currently your return value is [Dealer Code] and you are searching max dealer code per dealer code [allexcept(dealer code)]. So it will not find unique values.

So here are steps:
In first image, first parameter is min value that you want to return per specific criteria. And criteria should be inside AllExcept function (AllExcept means group by: so you will get some value per criteria1, criteria2, criteria3..).
In second image make sure to have as many lookup parameter as needed to make sure you have unique value to return.

Anonymous
Not applicable

You kinda lost me on that one. How do I need to write that to get it to work? I just want to get the dealer code to show up in the other table? 

 

 

Anonymous
Not applicable

Hi @Anonymous,

Can you please share some dummy data to test? It should help to test and trouble your code.

How to Get Your Question Answered Quickly 

Notice: remove sensitive data before share.
Regards,
Xiaoxin Sheng

Anonymous
Not applicable

I tried that and got too many arguments. So, here is what I am tryining to do, may there is a better way to do it.

 

In table FedEx Query I want to add a new column that will show a value. I need to use the Shipper Reference column to match the same value in column Pallet_ID in the table called DLX Report Query. That value I need to show in the new column in the table FedEx Query is called Dealer Code in the DLX Report Query. Sorry I am a little new at this, so it a bit confusing.

 

'FedEx Query'[Shipper Reference]    Need too use this number

'DLX Report Query'[PALLET_ID]       And Reference this number

'Report Query'[Dealer Code]         Need to show this column that has duplicates

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.