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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Use of something Like PROCV in Excel ( OR LOOKUPVALUE IN DAX )

Hey Guys !

I'm facing a little trouble in one of my projects.

Actually, I'm trying to do something simple

I Have a Table with numerous entries of data about a lots of products.
Something Like this: 

 

DateProductProduct description 2yEARMonth
20/07/22XAAAA202201
20/06/22YBBBB202201
20/05/22ZCCCC202201
20/04/22ADDDD202201

 

And other table with the costs of each product, but the costs varies per month.

YearMonthproductCost
202105X10
202105Y10
202105Z10
202205X14
202204Y14
202203Z14
202205A14
202204X14


I tried to create a conditional column, using LOOKUPVALUE , Something like this:

Column = LOOKUPVALUE('Cost'[Cost],'Cost'[Year],Products[Year],'Cost'[Month],Products[Month],Prodcuts[Month],'Cost'[Product],products[Product])


But, i got an error 

A table of multiple values ​​was provided, where a single value was expected.

So... Any ideias of Any idea what's going on ?

🙂

3 ACCEPTED SOLUTIONS
WinterMist
Impactful Individual
Impactful Individual

@Anonymous 

 

Is this what you are looking for?

 

WinterMist_4-1658439637103.png

 

I don't believe you can compare Cost[Year] or Cost[Month] with Data[Date].

To make the comparison, I first had to create Year & Month columns within the Data table as well.

 

WinterMist_1-1658439457501.pngWinterMist_2-1658439472823.pngWinterMist_3-1658439494733.png

 

Hopefully this is helpful to you.

 

Regards,

Nathan

 

 

View solution in original post

Anonymous
Not applicable

Hey Nathan !

You are totally correct and i Did that.

The Columns that i created ( Month and Year ) was based on the data Column.

And i compared them just like I did in My formula:

Column = LOOKUPVALUE('Cost'[Cost],'Cost'[Year],Products[Year],'Cost'[Month],Products[Month],Prodcuts[Month],'Cost'[Product],products[Product])

View solution in original post

WinterMist
Impactful Individual
Impactful Individual

@Anonymous 

 

If I copy/paste your code and separate it to become more user-friendly, it reads as follows:

 

WinterMist_0-1658503395558.png

 

After the first parameter (the return value), the rest of the parameters should come in pairs.  But the misspelled parameter above highlighted in red is not part of a matching pair.  I believe this should be removed.

 

Try that and see if it makes a difference.

 

Regards,

Nathan

View solution in original post

4 REPLIES 4
WinterMist
Impactful Individual
Impactful Individual

Hello @Anonymous 

 

Any update?  Were you able to resolve the issue?

 

Regards,

Nathan

WinterMist
Impactful Individual
Impactful Individual

@Anonymous 

 

If I copy/paste your code and separate it to become more user-friendly, it reads as follows:

 

WinterMist_0-1658503395558.png

 

After the first parameter (the return value), the rest of the parameters should come in pairs.  But the misspelled parameter above highlighted in red is not part of a matching pair.  I believe this should be removed.

 

Try that and see if it makes a difference.

 

Regards,

Nathan

WinterMist
Impactful Individual
Impactful Individual

@Anonymous 

 

Is this what you are looking for?

 

WinterMist_4-1658439637103.png

 

I don't believe you can compare Cost[Year] or Cost[Month] with Data[Date].

To make the comparison, I first had to create Year & Month columns within the Data table as well.

 

WinterMist_1-1658439457501.pngWinterMist_2-1658439472823.pngWinterMist_3-1658439494733.png

 

Hopefully this is helpful to you.

 

Regards,

Nathan

 

 

Anonymous
Not applicable

Hey Nathan !

You are totally correct and i Did that.

The Columns that i created ( Month and Year ) was based on the data Column.

And i compared them just like I did in My formula:

Column = LOOKUPVALUE('Cost'[Cost],'Cost'[Year],Products[Year],'Cost'[Month],Products[Month],Prodcuts[Month],'Cost'[Product],products[Product])

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors