Forum Discussion

yenyengo7's avatar
yenyengo7
Frequent Visitor
4 years ago
Solved

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.
ProductVolume_LYTotal Volume LY
Product 1523
Product 2423
Product 3623
Product 4823
Total2323

 

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?

ProductCategoryVolume_LYTotal Volume LY
Product 1Protein59
Product 2Protein49
Product 3Produce614
Product 4Produce814
Total 2323
  • Try,

     

    Total Volume LY = 

       CALCULATE(

                 Sum([Volume_LY]), 

                    ALL([Product],

                    ALL([Category]

    )

3 Replies

  • yenyengo7's avatar
    yenyengo7
    Frequent Visitor

    I mean Total Volume LY to remain at 23 in all lines or products. 

  • Try,

     

    Total Volume LY = 

       CALCULATE(

                 Sum([Volume_LY]), 

                    ALL([Product],

                    ALL([Category]

    )

  • yenyengo7's avatar
    yenyengo7
    Frequent Visitor
    Can 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.