Forum Discussion
Running total with ALL() is affected by visual filter
- 4 years ago
Hi, Anonymous
If your just want the four slicers (filters) on the page are affected, please try formula as below:
RunningTotal = VAR MaxCategory = MAX ( table[category] ) RETURN CALCULATE ( DISTINCTCOUNT ( table[issues] ), FILTER ( ALL ( table ), table[slicer_1] = MAX ( table[slicer_1] ) && table[slicer_2] = MAX ( table[slicer_2] ) && table[slicer_3] = MAX ( table[slicer_3] ) && table[slicer_4] = MAX ( table[slicer_4] ) && table[category] <= MaxCategory ) )Best Regards,
Community Support Team _ Eason
Try:
RunningTotal =
VAR MaxCategory =
MAX ( table[category] )
RETURN
CALCULATE (
DISTINCTCOUNT ( table[issues] ),
FILTER ( ALL ( table ), table[category] <= MaxCategory )
)
- Anonymous4 years agoNot applicable
Thank you very much PaulDBrown, I think we get closer to the solution, that gives me hope. I did it exactly you described, and checked if the calculation changes, when applying a visual filter and see the calculation is still the same and it is correct. But now I have a nother problem. My four slicers (filters) on the page are affected when using ALL() on the whole table. So the calculation is correct, but the predifined slicer values are missing, so the calculation is not that I want to have. Is there any way, to tell the measure like: Do ALL, but keep the necessary slicers values?
Thank you in advance!
EDIT:Have tried following, but calculation changes when using table[category] as visual filter.
RunningTotal = VAR MaxCategory = MAX ( table[category] ) RETURN CALCULATE ( DISTINCTCOUNT ( table[issues] ), FILTER ( ALLEXCEPT ( table, table[slicer_1], table[slicer_2], table[slicer_3], table[slicer_4] ), table[category] <= MaxCategory ) )- PaulDBrown4 years ago
Community Champion
Try using ALL(Table[Category])... instead of ALL(Table)....
- Anonymous4 years agoNot applicable
Thanks PaulDBrown, unfortuanely the calculation is still changing, when filtering some categories out with visual filter...
- v-easonf-msft4 years ago
Community Support
Hi, Anonymous
If your just want the four slicers (filters) on the page are affected, please try formula as below:
RunningTotal = VAR MaxCategory = MAX ( table[category] ) RETURN CALCULATE ( DISTINCTCOUNT ( table[issues] ), FILTER ( ALL ( table ), table[slicer_1] = MAX ( table[slicer_1] ) && table[slicer_2] = MAX ( table[slicer_2] ) && table[slicer_3] = MAX ( table[slicer_3] ) && table[slicer_4] = MAX ( table[slicer_4] ) && table[category] <= MaxCategory ) )Best Regards,
Community Support Team _ Eason- Anonymous4 years agoNot applicable
Hi v-easonf-msft thank you very much, unfortuanely it does still not work.
- Mr_Jones2 years agoNew Member
Thank you PaulDBrown - this really helped me. I adapted your example from DISTINCTCOUNT to SUM for what I needed.