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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gugge
Helper I
Helper I

Issue with LOOKUPVALUE giving error message

Hi,

I'm trying to make a simple table with data from other tables with SUMMARIZE and LOOKUPVALUEBut when using that LOOKUPVALUE-formula, I'm getting the "A table of multiple values was supplied where a single value was expected." I cant understand why this happens. I've tried to change the [Name] column to other columns in that table and some are working and some are getting the error. What am I missing here?

 

Table called DataCheckNav_vs_SF

 

My first column is a summarize of our Customer Data in NAV;

NAV_ERPno = SUMMARIZE(
NAV_CustomerData,
NAV_CustomerData[workflowCustomers.number])
 
Second column get the name from the same table;
NAV_Name2 = LOOKUPVALUE(
NAV_CustomerData[workflowCustomers.name2],
NAV_CustomerData[workflowCustomers.number],
DataCheckNav_vs_SF[NAV_ERPno])
 
Third column, checks if we have the number in SalesForce;
SF_ERP no =
LOOKUPVALUE(
SF_Account[ERP_ID__c],
SF_Account[ERP_ID__c],
DataCheckNav_vs_SF[NAV_ERPno]
)
 
My fourth column is supposed to get the name we have in SalesForce by using this formula;
SF_name =
LOOKUPVALUE(
SF_Account[Name],
SF_Account[ERP_ID__c],
DataCheckNav_vs_SF[NAV_ERPno]
)
But it doesn't work.
 
1 ACCEPTED SOLUTION

@Guggemy best guess is SF_Account[Name] has multiple values against each unique SF_Account[ERP_ID__c].

 

Error Reproduced here

 

/* table name _left*/
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}})
in
    #"Changed Type"
/* table name _right*/
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWBsgwMwGwnINsIzHIGsoyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ValA = _t, ValB = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ValA", type text}, {"ValB", Int64.Type}})
in
    #"Changed Type"

 

 

Now, try this as calculated column in _left. You will see the issue.

 

Column = LOOKUPVALUE(_right[ValB],_right[ValA],_left[Column1])

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

9 REPLIES 9
v-shex-msft
Community Support
Community Support

Hi @Gugge,

Can you please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

I recreated a excel file that gives me the same error, I'm unsure on how to upload  a file here so i uploaded it to a file sharing site. https://ufile.io/hnbqmwg0 
All the data is fake, but it gives me the same error when trying to create the table with the below formulas, the first three works but the last one gives the error "A table of multiple values was supplied where a single value was expected."

DataCheckNav_vs_SF = 
            SUMMARIZE
                (NAV_CustomerData,
                NAV_CustomerData[NAV_FAKEno])
NAV_Name2 = LOOKUPVALUE(
    NAV_CustomerData[NAV_Fakename2],
    NAV_CustomerData[NAV_FAKEno],
    DataCheckNav_vs_SF[NAV_FAKEno]
    )
SF_ERP no = 
    LOOKUPVALUE(
            SF_Account[SFFAKE_ERPID],
            SF_Account[SFFAKE_ERPID],
            DataCheckNav_vs_SF[NAV_FAKEno]
            )
SF_name = 
    LOOKUPVALUE(
            SF_Account[SFFAKE_name],
            SF_Account[SFFAKE_ERPID],
            DataCheckNav_vs_SF[NAV_FAKEno]
            )

 

DemoFour
Responsive Resident
Responsive Resident

Hi @Gugge

Would this not be eaiser in the query editor, where you can merge and create tables with the required columns a bit eaiser. 
 

Hi, thank you for the answer. It might be easier, but I do not have the knowledge on how to solve that with a query.

DemoFour
Responsive Resident
Responsive Resident

Morning @Gugge 

 

It is very easy to do this in the Query Editor, Merging tables and choosing your columns, if you do not have a unique ID for these, you can also create one. 

LOOKUPVALUE often gives that message when it scans the table and it is not clear which result it can find as there are several options. 



If you want to find more about this, try these videos. 

SQLBI introducing lookupvalue 

SQLBI Understanding lookupvalue

 





If you want some help with the Query way, I would be happy to guide you if you provide some dummy data. 

smpa01
Super User
Super User

@Gugge  SUMMARIZE returns a table. Are you trying to use this to generate a Calculated Column? It is probably giving you the error.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Gugge_1-1625768802860.png

 

Thanks you for your answer.

This is  how it looks. I've created a table by using SUMMARIZE, then I want to expand the table to be able to cross check information. The first three LOOKUPVALUE columns work, I added in one just to show what happens. As seen in the picture, when there is no result it returns a blank cell and when it is a result it returns the data. But for the Name column, all I'm getting is #ERROR and the message "A table of multiple values was supplied where a single value was expected."

 

SF_city =
LOOKUPVALUE(
SF_Account[BillingCity],
SF_Account[ERP_ID__c],
DataCheckNav_vs_SF[NAV_ERPno]
)
 
SF_name =
LOOKUPVALUE(
SF_Account[Name],
SF_Account[ERP_ID__c],
DataCheckNav_vs_SF[NAV_ERPno])

@Guggemy best guess is SF_Account[Name] has multiple values against each unique SF_Account[ERP_ID__c].

 

Error Reproduced here

 

/* table name _left*/
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}})
in
    #"Changed Type"
/* table name _right*/
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJUitWBsgwMwGwnINsIzHIGsoyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ValA = _t, ValB = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ValA", type text}, {"ValB", Int64.Type}})
in
    #"Changed Type"

 

 

Now, try this as calculated column in _left. You will see the issue.

 

Column = LOOKUPVALUE(_right[ValB],_right[ValA],_left[Column1])

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi,

Recreated this and you are correct. I have some duplicate values in my SF_Account column ERP_No. Removed them from my excel test I posted here and it works.

 

Still strange that some columns works and some doesn't, but now I know where to start when solving this. Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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