Forum Discussion

xuexi1890's avatar
xuexi1890
Icon for Helper I rankHelper I
7 years ago
Solved

Grand Total ALL() with filter

Hello,   I have created a measure  Grand Total = CALCULATE(sum(Table1[Resale Qty]),all(Table1[Resale Price]))   when i don't filter Product, everything seems correct. P1 when i filter Product,...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi xuexi1890 ,

     

    I think i got the solution at last

     

    Grand Total =
    VAR _product =
        ALLSELECTED ( Table1[Product] )
    VAR _Month =
        ALLSELECTED ( Table1[Resale Invoice Month] )
    RETURN
        CALCULATE (
            SUM ( Table1[Resale Qty] ),
            ALL ( Table1 ),
            Table1[Product] IN _product,
            Table1[Resale Invoice Month] IN _Month
        )

    1.When no filter on Product or Month is selected it computes the total for the entire table.

    2.When a Filter on Product alone is selected it computes the total for only that product for all months in the table.

    3. When a filter on Month alone is selected it computes the total for only those Months for all products.

    4. When a Product and Month is filtered, it computes the total for only those Products and those Months selected.

     

    This should work.

     

    Cheers

     

    CheenuSing