Forum Discussion
yenyengo7
4 years agoFrequent Visitor
Using the ALL function when there is grouping or subgroup
I have created a measure with below DAX
Total Volume LY = CALCULATE(Sum([Volume_LY]),ALL([Product]))... it works okay.
| Product | Volume_LY | Total Volume LY |
| Product 1 | 5 | 23 |
| Product 2 | 4 | 23 |
| Product 3 | 6 | 23 |
| Product 4 | 8 | 23 |
| Total | 23 | 23 |
But when I merged it with another table to view Category, the Tolal Volume LY now change to below. How do I keep the Total Volume LY to remain at 23 same as above table?
| Product | Category | Volume_LY | Total Volume LY |
| Product 1 | Protein | 5 | 9 |
| Product 2 | Protein | 4 | 9 |
| Product 3 | Produce | 6 | 14 |
| Product 4 | Produce | 8 | 14 |
| Total | 23 | 23 |
Try,
Total Volume LY =
CALCULATE(
Sum([Volume_LY]),
ALL([Product],
ALL([Category]
)
3 Replies
- yenyengo7Frequent Visitor
I mean Total Volume LY to remain at 23 in all lines or products.
- thiagocamillo
Helper I
Try,
Total Volume LY =
CALCULATE(
Sum([Volume_LY]),
ALL([Product],
ALL([Category]
)
- yenyengo7Frequent VisitorCan you please help me understand why below DAX does not work?Total Product Days LY (Rate) = CALCULATE(Sum(Monthly[Product_Days_LY]),ALL(Monthly[Rate Segment]))
I need the Total Product Days LY (Rate) to be 4,366,472 across all Rate Segments.