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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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]) 

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
FreemanZ
Super User
Super User

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.