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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Unable to pass a variable using LOOKUPVALUE

I'm currently trying to pull a value from a different row in a table using the LOOKUPVALUE command but I'm encountering a problem.

 

Landmark = 
VAR trailerid = 'Table'[Trailer ID]
RETURN
LOOKUPVALUE('Table'[Landmark], 'Table'[Index], 'Table'[Index Prior],'Table'[Trailer ID], trailerid)

 

Above is the code I've been trying to use but it doesnt work in its current state and I get the error "A table of multiple values was supplied where a single value was expected." 

 

However, when I format like so:

Landmark Prior = 
LOOKUPVALUE('Table'[Landmark], 'Table'[Index], 'Table'[Index Prior],'Table'[Trailer ID], "8543")

 

The above code works properly when formatted manually for the trailer id "8543". 

 

Is there a particular reason why trying to pass a variable through will not work on this code?   I can provide more context if necessary, I'm just hoping I did something stupid thats easy to fix at first glance from somebody smarter than me.

 

Thanks

 

 

2 REPLIES 2
AntrikshSharma
Super User
Super User

Are you trying to use LOOKUPVALUE on the dimension table and the values are on the many side of the relationship? If yes, then you should use an Iterator like FILTER & RELATEDTABLE to get a list of all the values that are related to the current row in the table.
amitchandak
Super User
Super User

@Anonymous , Try

minx(filter('Table','Table'[Index] = earlier( 'Table'[Index Prior]) && 'Table'[Trailer ID] = "8543"),'Table'[Landmark])

Or

minx(filter('Table','Table'[Index] = earlier( 'Table'[Index]) && 'Table'[Trailer ID] = "8543"),'Table'[Landmark])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.