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
Syndicate_Admin
Administrator
Administrator

Bring a value only once to a column with repeated values with lookupvalue

Good night

They could help me with the next problem

I want to find the values in the quantity column of table 2 and bring them only once to table 1, so the key is repeated.

""RESULT =LOOKUPVALUE (TABLE2[QUANTITY],TABLE2[SKU],TABLE1[SKU])""

this is what I hope
TABLA1
SKUProductRESULT
1234aA110
1234aA1-
1234aA1-
5555cB120
6666bB230
7777dB340
TABLA2
SKUQuantity
1234a10
5555c20
6666b30
7777d40

Here's what it delivers

TABLA1
SKUProductRESULT
1234aA110
1234aA110
1234aA110
5555cB120
6666bB230
7777dB340

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

Hi @DADAZA1032 ,

 

Sorry for my missunderstanding, here I updated my reply.

1.Add an index column group by [Product] in Power Query. You can refer to the detailed steps:

How to create group index with Power Query or R - (example in Power BI) (datacornering.com)

vstephenmsft_0-1665562066488.png

And pay attention to convert the index column to number type.

 

2.Create a calculated column to get the results in Desktop.

RESULT = IF([Index]=1,RELATED(Table2[Quantity]))

vstephenmsft_1-1665562330210.png

 

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @DADAZA1032 ,

 

Sorry for my missunderstanding, here I updated my reply.

1.Add an index column group by [Product] in Power Query. You can refer to the detailed steps:

How to create group index with Power Query or R - (example in Power BI) (datacornering.com)

vstephenmsft_0-1665562066488.png

And pay attention to convert the index column to number type.

 

2.Create a calculated column to get the results in Desktop.

RESULT = IF([Index]=1,RELATED(Table2[Quantity]))

vstephenmsft_1-1665562330210.png

 

 

Best Regards,

Stephen Tao

 

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

 

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.