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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PhoenixBird66
Helper III
Helper III

DAX to sum up a value grouped by another column

I want to create a new column called [KG of Batch] which sums up the values from another column [WeightOfBatchLine], grouped by another column [Batch Header No]. All of these fields are on the same table.

See the example in my picture below.

Any help greatly appreciated.

 

Capture.JPG

1 ACCEPTED SOLUTION
ZunzunUOC
Resolver III
Resolver III

Hi @PhoenixBird66 , you can use the next calculated column:

 

KG of Batch = 
var VarId='Batch'[Batch Header No.]
return
CALCULATE(SUM('Batch'[WeightOfBatchLine]);FILTER('Batch';'Batch'[Batch Header No.]=VarId))

 

 

Best Regards,
Miguel

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
ZunzunUOC
Resolver III
Resolver III

Hi @PhoenixBird66 , you can use the next calculated column:

 

KG of Batch = 
var VarId='Batch'[Batch Header No.]
return
CALCULATE(SUM('Batch'[WeightOfBatchLine]);FILTER('Batch';'Batch'[Batch Header No.]=VarId))

 

 

Best Regards,
Miguel

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.