Forum Discussion

MarioDias's avatar
MarioDias
Frequent Visitor
5 years ago
Solved

Summarize Running Total that resets as categories changes

I am trying to write a SUMMARIZE function that calculates Running Total based on a determined category:

 

Table

Category 1Category 2TotalRunning Total (goal)
AppleBasket 155
AppleBasket 21015
OrangeBasket 3

20

20
AppleBasket 42020
AppleBasket 5525

 

I can solve this using DAX + Table visual, because it resets per Category 1:

Running Total =

CALCULATE(
    SUM(Table[Total),
    FILTER(
        ALLSELECTED(Table[Category 2]),
        ISONORAFTER('Table'[Category 2], MAX('Table'[Category 2]), DESC)
    )
)

But I cannot get the same result when using SUMMARIZE as it will just repeat the totals instead of cumulating them accordingly. I need to have it in summarize to apply further filtering for another measure.

Anyone please, any idea?

Thank you!
  • Hello  everyone.

    It looks like switching ALLSELECT by ALLEXCEPT solves the problem. Thanks parry2k for all the messages.

4 Replies

    • MarioDias's avatar
      MarioDias
      Frequent Visitor

      Thanks for your message parry2k 
      I will used SUMMARIZE to filter rows and get a scalar value. Filters like showing categories with less than specifict totals.

  • MarioDias still not sure what you are looking for? Maybe if you provide data with the expected results, it will help.

  • MarioDias's avatar
    MarioDias
    Frequent Visitor

    Hello  everyone.

    It looks like switching ALLSELECT by ALLEXCEPT solves the problem. Thanks parry2k for all the messages.