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
Sgb1201
Helper I
Helper I

Using lookupvalue error because of duplicates

Hey, 

 

I'm using a lookupvalue function in one of my columns to get values from another table in my dataset, but I'm getting an error. I think this is because of duplicates in the item value collumn: 

Sgb1201_0-1661849576979.png

I've tried removing duplicates in the query editor, but it leaves the above "duplicates", possibly because of the two different values in the third column. Is there an easy way (either in DAX or M) to make it simply choose the first value (in the third column) and delete the second as it is redundant -- and thereby removing the duplicate item values (first column?) 

Best regards, 
Sgb

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Sgb1201 , You can try like , a new column in table 1

 

Maxx(filter(Table2, Table1[ID] = Table2 [ID] ), Table2[Column])

 

Sumx(filter(Table2, Table1[ID] = Table2 [ID] ), Table2[Value])

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

2 REPLIES 2
Sgb1201
Helper I
Helper I

@amitchandak , I got it to work with the first part (Maxx(filter(Table2, Table1[ID] = Table2 [ID] ), Table2[Column])), where the Table2[Column] is the first column (item number), right? 

The second part does not work -- what does it do exactly? 

Either way, it seems to work correctly without the second part anyways, thanks alot for the help! 

amitchandak
Super User
Super User

@Sgb1201 , You can try like , a new column in table 1

 

Maxx(filter(Table2, Table1[ID] = Table2 [ID] ), Table2[Column])

 

Sumx(filter(Table2, Table1[ID] = Table2 [ID] ), Table2[Value])

 

refer 4 ways 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.