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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Mueez
Frequent Visitor

Help Needed with Lookup Function

Hi,

 

I have a very simple code in calculated cloumns where I am using lookup value to get required information from another table.

 

=LOOKUPVALUE('Knock off details for AP'[Document No.],'Knock off details for AP'[Vendor Ledger Entry No.],'Vendor Ledger Entries'[Entry No.],'Knock off details for AP'[Entry Type],"Application")

 

It is giving me the following error: Calculation error in column 'Vendor Ledger Entries'[]: A table of multiple values was supplied where a single value was expected. 

 

I have manually checked and if done right above syntax should give only 1 result. Can someone please guide where I'm getting the code wrong.

 

 

Regards,

Mueez

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Mueez ,

 

I give an sample.

I have two tables like this.

--Table

v-lionel-msft_0-1601281928537.png

--Table(2)

v-lionel-msft_1-1601281985964.png

Then I create a calculated column in 'Table'.

v-lionel-msft_2-1601282038701.png

The cause of the error is this, Table(2) has two values that are not aggregated.

v-lionel-msft_3-1601282135032.png

You can do like this.

1. Create a calculated column in 'Table(2)'

v-lionel-msft_4-1601282378396.png

2. LOOKUPVALUE()

v-lionel-msft_5-1601282407149.png

 

Best regards,
Lionel Chen

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

View solution in original post

6 REPLIES 6
v-lionel-msft
Community Support
Community Support

Hi @Mueez ,

 

I give an sample.

I have two tables like this.

--Table

v-lionel-msft_0-1601281928537.png

--Table(2)

v-lionel-msft_1-1601281985964.png

Then I create a calculated column in 'Table'.

v-lionel-msft_2-1601282038701.png

The cause of the error is this, Table(2) has two values that are not aggregated.

v-lionel-msft_3-1601282135032.png

You can do like this.

1. Create a calculated column in 'Table(2)'

v-lionel-msft_4-1601282378396.png

2. LOOKUPVALUE()

v-lionel-msft_5-1601282407149.png

 

Best regards,
Lionel Chen

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

Thank you so much! 

Much Thanks!

 

Regards,

Mueez

Fowmy
Super User
Super User

@Mueez 

For the criteria you provided in the LOOKUPVALUE function, there could be more than one value returned from 

'Knock off details for AP'[Document No.]. Please check the table 'Knock off details for AP'

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn
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

Mueez
Frequent Visitor

@Fowmy Thanks for replying

I am pretty sure there are no duplicates because when I change code as following I stop getting error.

= LOOKUPVALUE ('Cancellation details for AP' [Document No.], 'Knock off details for AP' [Vendor Ledger Entry No.], <hard code entry number>, 'Knock off details for AP' [ Entry Type], "Application" )

But this is obvioulsy not what I want. The formula needs to iterate through each line in of the table.

Best Regards,

Mueez

Mueez
Frequent Visitor

@Fowmy 

 

Also, even if say there are duplicates. Isn't there way we can handle those?

 

Regards,

Mueez

@Mueez 

A column cannot contain two Document Numbers. That is not the right way. But, you can still do it using CONCATNATEX and FILTER functions

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors