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
mtrevisiol
Helper IV
Helper IV

Calculated column with the sum by component and ID

Hi everyone.

I've got a table like this

mtrevisiol_2-1626102045677.png

 

My purpose is to create a column with the total sum for each component and for each MoID of the quantity needed for production:

mtrevisiol_3-1626102056371.png

 

What is the correct DAX formula to use? Thank you.

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

Hi, @mtrevisiol 

 

You can also try the column, like this:

Column = SUMX(FILTER('Table',[MoID]=EARLIER('Table'[MoID])&&[Compoent]=EARLIER('Table'[Compoent])),[Qty])

vjaneygmsft_0-1626252889587.png

 

Best Regards

Janey Guo

 

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

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @mtrevisiol 

 

You can also try the column, like this:

Column = SUMX(FILTER('Table',[MoID]=EARLIER('Table'[MoID])&&[Compoent]=EARLIER('Table'[Compoent])),[Qty])

vjaneygmsft_0-1626252889587.png

 

Best Regards

Janey Guo

 

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

PaulDBrown
Community Champion
Community Champion

Try:

TotalComponentQTY = CALCULATE(SUM(Table[Qty]), ALLEXCEPT(Table, Table[MoID], Table[Component]))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.