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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Dean_Mcghee
Frequent Visitor

sum with criteria

I have a columne with material, A column with order #, and A column with order qty.  I want to be able to look at the total qty of the material ordered for the shipment(order) and not sum every instance of the material in the data. How do you sum but only for the material and only for that one order? 

3 REPLIES 3
Dean_Mcghee
Frequent Visitor

This is an example of my data.Capture.JPG

The Source Target is the order amount of the material in column A.  For the first one, they orderd 72.  Thats what I need the measure to display.  Right now I have tried sum both alone and with filters, lookupvalue to create a new column.

Nothing I do works.  It either wants to sum all the material in the whole column, Or just count How many times that material shows up in the column.  I didn't think just pulling order qty would be so hard.

@Dean_Mcghee , Not sure why you need a new column

new column

total = sum(Table[Source Target Qty])

 

total of material = sumx(filter(Table, Table[Material] = earlier([Material]) ) , Table[Source Target Qty])

 

measure will be like

 

new column

total = calculate(sum(Table[Source Target Qty]), allselected()) //or use all in place of allselected

 

total of material = sumx(filter(allselected(Table), Table[Material] = max([Material]) ) , Table[Source Target Qty])

 

row level total = sum(Table[Source Target Qty]) 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
FreemanZ
Super User
Super User

it would be good if you could provide some sample data and your expected result. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.