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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Sum and Summarize from other table

Hi All,

How could I create a column in "ProductMaster" table, with a sum of the "linetotal" column in "OrderDetail_All" table, filtered by the "productID" column. A simple SUM gives me the sum of all the values ando not by ProductID.

 

eduardosilvin3_0-1671768828304.png

eduardosilvin3_1-1671769226068.png

 

Regards

 

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

vzhangti_0-1672052008397.png

Column = 
CALCULATE (
    SUM ( OrderDetail_All[LindTotal] ),
    FILTER ( OrderDetail_All, [ProductID] = EARLIER ( ProductMaster[ProductID] ) )
)

vzhangti_2-1672052079157.png

Is this the result you expect?

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

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

vzhangti_0-1672052008397.png

Column = 
CALCULATE (
    SUM ( OrderDetail_All[LindTotal] ),
    FILTER ( OrderDetail_All, [ProductID] = EARLIER ( ProductMaster[ProductID] ) )
)

vzhangti_2-1672052079157.png

Is this the result you expect?

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

FarhanAhmed
Community Champion
Community Champion

What are your relationship keys between those two tables ?  Make sure that direction is 1-M and cross filtering is set to single.

 

Also share the DAX of your "Total sales" Measure.







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , It should do the correct sum, Unless

 

1. Join is inactive 

2. You are using product ID from another table

3. You have a measure where you have used all or allselected , or filter without filter function

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.