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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Saxon10
Post Prodigy
Post Prodigy

LOOKUPVALUE-A table of multiple values was supplied where a single value was expected.

Hi,

 

I have a two table are Table1 and Table2.

I am trying to do lookupvalue DAX function "Lookupvalue =LOOKUPVALUE(TABLE2[TEX],TABLE2[ITEM],TABLE1[ITEM])" from Table2 to Table 1 but I am receiving the following error message "A table of multiple values was supplied where a single value was expected".

 

In Table2 the following items 284 and 685 has duplicate text and 686 has duplicated but unique text. In Table 1 I don't have any duplicate enrty. If we have a duplicate entry then pick the first text value from table2 to table1 according to the item.

 

 

Table1:
ITEMTEX
123RCB
124CHR
125RCB
126RCB
127CHR
128CHR
129RCB
130CHR
131CHR
284RCB
132RCB
133RCB
134RCB
135RCB
136RCB
137RCB
138RCB
139RCB
140RCB
141RCB
142RCB
143RCB
144RCB
145RCB
146RCB
147RCB
148RCB
149RCB
685RCB
686RCB

 

Table2:

ITEMTEX
123RCB
124CHR
125RCB
126RCB
127CHR
128CHR
129RCB
130CHR
131CHR
284DEL
284RCB
132RCB
133RCB
134RCB
135RCB
136RCB
137RCB
138RCB
139RCB
140RCB
141RCB
142RCB
143RCB
144RCB
145RCB
146RCB
147RCB
148RCB
149RCB
685DEL
685RCB
685RCB
686RCB
686RCB
686RCB

 

 

1 ACCEPTED SOLUTION
sanalytics
Super User
Super User

@Saxon10 ,
Lookupvalue sould return error..because  Table 2 have duplicate data.(Item 685,686).
if you want to pull out the value from table 2 to table 1 then your have to take first value.Try this measure,

 

Tex from Table 2 = CALCULATE(FIRSTNONBLANK('Table 2'[TEX],TRUE()), FILTER('Table 2','Table 2'[ITEM]=Table1[ITEM] ) )
 
You can find the pbix file from below link.
 
Regards,
sanalytics
if it is your solution please accept this as solution and like.

View solution in original post

6 REPLIES 6
sanalytics
Super User
Super User

@Saxon10 ,
Lookupvalue sould return error..because  Table 2 have duplicate data.(Item 685,686).
if you want to pull out the value from table 2 to table 1 then your have to take first value.Try this measure,

 

Tex from Table 2 = CALCULATE(FIRSTNONBLANK('Table 2'[TEX],TRUE()), FILTER('Table 2','Table 2'[ITEM]=Table1[ITEM] ) )
 
You can find the pbix file from below link.
 
Regards,
sanalytics
if it is your solution please accept this as solution and like.

Hi, 

The above CALCULATE returns one value for the matching item. What if I want to retrieve the TEXT (in my case, it's another column. I don't have that column in table 1) from Table 2 for all the matching items in Table 1. 

Thank you.

thanks for your reply. I will check quickly and update the feedback to you. Can you please explain what's the following function actually doing hete calculate and firstnonblank s9 it will help to understand the power bi DAX functionality 

@Saxon10

Sure.. I just used filter instead of Lookupvalue..
filter is an iterative function.it goes to the table 2 and picks up the item and compare to the table 1 item.if the two items are equal filter will take those items make a virtual table and pass to the calculate and calculate simply gives you the first value of table 2 which is item is equal to table 1 item . Since your table 2 date duplicate record so i had to use the firstnonblank function.

that's it.

Hope this will help

Regards,

sanalytics

if this is your solution please accept this as solution and like please

Hello sanalytcis, thank you for providing this solution. Could you please let me know if multiple conditions could be evaluated using the Filter function?

thanks for your explaining and solution.  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors