Forum Discussion
wilson_smyth
Post Patron
7 years agocalculate total quantity for each order
I am trying to calculate the total quantity of items on all lines of an order. So each line will show the quantity for the orderline, and the total order quantity. Model is simple, an order dime...
Zubair_Muhammad
Community Champion
7 years ago
If you were using the Column OrderID from Table1, this simple measure would have sufficed
Measure = Calculate(sum(Table1[Quantity]),ALL(Table1[OrderLineID]))
i..e to you just wanted to sum for all Line IDs
but because you are using OrderID from Orders Table we needed to use VALUES(Table1[OrderID]) to hide the LineorderIDs which do not exist in Table1
wilson_smyth
Post Patron
7 years agoThanks zubair_Mumammad. I understand this, but as my mode works by filtering and slicing using dimensions, this makes Table1 the fact table and i cant store slicable attributes in the fact.
thsi is why i have a seperate orders dimension. but what i dont understand is, in the model i have, how the dax expression you wrote is interperted by the dax engine.