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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Saxon10
Post Prodigy
Post Prodigy

Calculate sum (Unique) one table to another table

 

I have a two tables are table1 and table2.

 

In Table 1 contain item, country and value and Table 2 contain country code only.

 

Table1 and 2 the country code is common/related.

 

I am trying to calculate the sum of value by country code based on the unique item from table1 into table2.

 

I am looking for new calculated column.

 

Example:

 

If item and country code are same then in this case considered the first line item value. (Example- Item123)

 

Basically I am trying to ignore duplicate line item values.

 

Data:

 

TABLE 1

 

TABLE2

Item

Value

Country

 

Country

 Desired Result (Sum of value)

123

0.038

Ind

 

IND

0.076

123

0.038

Ind

 

Uk

1.591

123

0.038

Ind

 

Us

0.017

123

0.038

Ind

 

Aus

0.017

124

0.033

Uk

 

Ue

 

124

0.033

Uk

   

124

0.033

Uk

   

125

0.017

Aus

   

125

0.017

Aus

   

126

0.073

Us

   

127

0.068

Ue

   

789

0.038

Ind

   

56T

 

Ind

   

897

 

Aus

   

1546R

1.558

Uk

   

 

 

Saxon10_0-1623022460070.png

 

1 ACCEPTED SOLUTION

Hi,

Try these measures

Min value = MIN(Data[Value])
Measure = SUMX(VALUES(Data[Item]),[Min value])

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

For IND, why should the answer be 0.076?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the reply.

 

I am considering only unique items only, Example item 123 and 789 which is sum of value is 0.076.

 

Hi,

Try these measures

Min value = MIN(Data[Value])
Measure = SUMX(VALUES(Data[Item]),[Min value])

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the reply again. I am looking for new calculate column option can you please advise 

Hi,

A measure is the best way to solve this problem and i have already shared that way with you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors