March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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?
Solved! Go to Solution.
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 Code. Double-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.
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 Code. Double-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.
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]
)
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.
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
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.
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
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |