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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Cellblime
Frequent Visitor

Lookupvalue Returning an Error

I'm new to Power BI, but I believe I can describe this issue accurately.  I have a queried table, Letters, with a column, Letter Code.  I also have an imported Excel table, Letter Descriptions, with two columns, Description and Letter Code.  I'm attempting to add a column to the Letters table that will use LookUpValue to pull the Description column values from the Letter Descriptions table over by matching the Letter Code columns.

 

Letter Description = (LOOKUPVALUE('Letter Descriptions'[Description],'Letter Descriptions'[Letter Code], Letters[Letter Code]))

 

I receive an error, "A table of multiple values was supplied where a single value was expected.".  My understanding is that this means there are duplicate values on the Letter Descriptions table, however there are no duplicates/blanks.  The data type on both tables is Text.  The Letter Code column on the Letters table WILL have duplicates because there are multiple letters sent each day of the same letter code, however, this seems like it should work like vlookup on Excel and duplicates on the Letters table shouldn't cause an issue with applying the same description to the same letter codes.

 

Can you explain where I went wrong, or why this, seemingly easy lookup, is causing a problem?

1 ACCEPTED SOLUTION
Bibiano_Geraldo
Resident Rockstar
Resident Rockstar

Hi @Cellblime ,
It sounds like you’re on the right track with using LOOKUPVALUE, but the error you’re encountering typically means that there are multiple matching values in the Letter Descriptions table for a given Letter CodeDouble-check that the Letter Code column in the Letter Descriptions table truly has unique values.

 

Use FIRSTNONBLANK BUT NOTE: This will only return the first non blank value found, ignoring all other's.

 

Letter Description = 
CALCULATE(
    FIRSTNONBLANK('Letter Descriptions'[Description], 1),
    FILTER('Letter Descriptions', 'Letter Descriptions'[Letter Code] = Letters[Letter Code])
)

 

 
I hope this help you, if so, please accept as solution and give a Kudo.

 

Thank you.

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

View solution in original post

6 REPLIES 6
Bibiano_Geraldo
Resident Rockstar
Resident Rockstar

Hi @Cellblime ,
It sounds like you’re on the right track with using LOOKUPVALUE, but the error you’re encountering typically means that there are multiple matching values in the Letter Descriptions table for a given Letter CodeDouble-check that the Letter Code column in the Letter Descriptions table truly has unique values.

 

Use FIRSTNONBLANK BUT NOTE: This will only return the first non blank value found, ignoring all other's.

 

Letter Description = 
CALCULATE(
    FIRSTNONBLANK('Letter Descriptions'[Description], 1),
    FILTER('Letter Descriptions', 'Letter Descriptions'[Letter Code] = Letters[Letter Code])
)

 

 
I hope this help you, if so, please accept as solution and give a Kudo.

 

Thank you.

I hope this helps! 
If you found this answer helpful:
✔️ Mark it as the solution to help others find it faster.
 Give it a like to show your appreciation!

Thank you for contributing to our amazing Power BI community! 

That worked, thanks!  I had tried something similar that ChatGPT provided (see below), but I was getting an error.  Your help is much appreciated!

 

Letter Description =
CALCULATE(
FIRSTNONBLANK(LetterDescriptions[Letter Description], 1),
LetterDescriptions[Letter Code] = Letters[Letter Code]
)

Ashish_Mathur
Super User
Super User

Hi,

Ensure that your formula is a calculated column formula (not a measure).  If this does not help, then share some data to work with. Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
PhilipTreacy
Super User
Super User

@Cellblime 

 

Please supply some sample data. 

 

You describe the Letters table as only having 1 column?  But is that really the case?  What is the point of that table?

 

In this case what is a Letter?  Something like A, B etc or a written correspondence?

 

From what you are trying to do it sounds like you will end up with the same table in both cases?  Both containing Letter Description and Letter Code?

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


The Letters table has a few additional fields, I was just trying to avoid complicating the question. The Letters table data is queried and there is no description of the letter code on the database so I created a separate Excel sheet with the description and corresponding letter code, and imported it so I could add the missing description to the Letters table. The Letters table has the following fields, Letter Date, Letter Code, Delivery Method and Customer Number. The Letter Code is a 4 character value with one letter and three numbers, like A123.

ryan_mayu
Super User
Super User

It's because one code may has differetn description. You need to double check your data to see if there is any space that caused this issue. 

If the issue can't be fixed, pls provide some sample data and expected ouptut, or provide your pbix file





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.