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
TotunG
Resolver I
Resolver I

Fixing LOOKUPVALUE Calculated Column Formula

I have a LOOKUPVALUE formula that previously worked before I added more 'Years' of data. The formula works by trying to find the a value in a table by looking at a code product code and matching it with the product code in the same row. 

 

However, because I have added more rows of data which has 'duplicate' product codes (as they are from prior years), this has now broken as it obviously there are multiple product codes that are found. 

 

I thought my 'Year' slicer that is related to the main table would allow this column to calculate still as it should be filtering the main table LOOKUPVALUE is searching? 

 

Would a normal measure be better instead and if so, how would I achieve this?

 

Max Value = LOOKUPVALUE ( 'Table'[Value],'Table'[Product Code],'Table2'[Product Code])
 
Any help / explanation is appreciated. 
2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @TotunG 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

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

amitchandak
Super User
Super User

@TotunG , Try like

 

Max Value = MaxX(Filter('Table','Table'[Product Code]= 'Table2'[Product Code]), 'Table'[Value])

 


refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

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.

Top Solution Authors