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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Lookupvalue function returns error

Hello

 

I'm trying to lookup value (list prise) in one input table:

inDiana_0-1622462056218.png

and merge it with the following table

inDiana_3-1622462175113.png

to get the following resul table (list price is the same ragardless the date)

inDiana_2-1622462145944.png

However, Lookupvalue formula returns an error "A table with multiple values was returned when a single value was expected". 

 

Any idea what causes the error and how to solve it?

 

Thank you!

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Check your 1st table for duplicate values  in product column. you try the following as well:

ListPrice = 
MAXX(
    FILTER(
        table-1,
        table-1[product]=EARLIER(table-2[product])
    ),
    table-1[List Price]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
ERD
Super User
Super User

Hi @Anonymous ,

What formula did you use?

Here is an example for a measure:

#lookupLP = 
LOOKUPVALUE(InputTable[LP], InputTable[Product], MAX(FollowingTable[Product]))

If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Fowmy
Super User
Super User

@Anonymous 

Check your 1st table for duplicate values  in product column. you try the following as well:

ListPrice = 
MAXX(
    FILTER(
        table-1,
        table-1[product]=EARLIER(table-2[product])
    ),
    table-1[List Price]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

selimovd
Super User
Super User

Hey @Anonymous ,

 

did you create it as a calculated column?

Try the following calculated column:

List Price = LOOKUPVALUE( 'Product'[List price], 'Product'[Product], Retail[Product] )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.