Forum Discussion
MarioDias
5 years agoFrequent Visitor
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 1 | Category 2 | Total | Running Total (goal) |
| Apple | Basket 1 | 5 | 5 |
| Apple | Basket 2 | 10 | 15 |
| Orange | Basket 3 | 20 | 20 |
| Apple | Basket 4 | 20 | 20 |
| Apple | Basket 5 | 5 | 25 |
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!
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.