Forum Discussion
cumulative sum issues when filtering
ImkeF Perfect, just getting my head around. I tried using crossjoin between date and gender in your calculation but it didn't work. I then tried replacing date with gender in crossjoin in your calculation and seems working. So is it that to get the right context for the running total we need a filter table and as we need two parameter for cross join, any field from the table will do the trick as long as one of the field is attrition flag as running total need to be across the attrition flag? Please enlighten me or point me to the right blog:)
I also tried one of the calculation earlier in the thread and seems to be working.
Cumulative Pledges 4 =
CALCULATE (
[Pledges],
FILTER (ALLSELECTED(DimAttrition[Attrition Flag]),
DimAttrition[Attrition Flag] <= MAX ( DimAttrition[Attrition Flag])
)
)
May be i need a break, sure doing something wrong here...
Thanks for your help
Your last measure works because it references the separate Dimension-Table “DimAttrition” This hasn’t been used earlier in this thread. This measure will also work for the date-filter if you run it from a separate calendar table, so you could omit the crossjoin then.
Please find some explanations about the tricky behaviour of ALLSELECTED here: https://www.sqlbi.com/articles/understanding-allselected/