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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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