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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
francesg
Helper I
Helper I

Conditional Sum. Need to sum column a per location, then get the MAX column 2 or same data in DAX

Hi,

 

I need help with the creation of summation specific column using DAX.
I could not think of adding quantity for a specific column; and the cost column should be the same. (sample table below)
I did the "sum" in the column item quantity, but it also sums up the item cost column. So, I put it back to "Don't summarize."

 

scenario:

Problem:    
Warehouse No.ItemWarehouse LocationItem QuantityItem Cost
A100WheelOrange0200.75
B200HandleRed0200.75
B200HandlePink1200.75
B200HandleBlue1200.75
B200HandleBlue6200.75

 

Expected output in the report should be: 

Warehouse No.ItemWarehouse LocationItem QuantityItem Cost
A100WheelOrange0200.75
B200HandleRed0200.75
B200HandlePink1200.75
B200HandleBlue7200.75

 

Appreciate anyone's help. 

Thank you 

 

1 ACCEPTED SOLUTION

@francesg 
This is what I mean. See attached file

1.png

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @francesg 
You summarze "Item Quantity" by sum and summarize "Item Cost" by max or min

Hi @tamerj1 

 

i tried this measure, 

SubTotal ItemQty = MAX('Table_Inventory'[ItemCost], SUM('Table_Inventory'[ItemQty]))

 

but i get an error:

"A single value for column 'ItemCost' in the table 'Table_Inventory' cannot be determined.  This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count..... "

 

Appreciate your help

@francesg 
This is what I mean. See attached file

1.png

Hi@tamerj1 

 

Woow it got what i expected output.  (i got myself too complicated for the solution) 😀

Thanks so much.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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