Forum Discussion
Cumulative sum without date field
I am trying to create a Cumulative Sum field that adds up the "Every Chargeback" column. I am looking at all data from 2011 though today and breaking that up by the "CHGBACK DAY OF MONTH". The problem I am having is the system doesn't know how to do this because it is looking at data that happened on the 1st day of every month over every year. Here is the formula I was trying to get to work. Any help would be appreciated.
Cumulative Every Chargeback = [Total Chargebacks] (FILTER(ALLEXCEPT('Date Chrgback', 'Date Chrgback'[CHGBACK DAY OF MONTH]), min('Date Chrgback'[CHGBACK DAY OF MONTH]) <= MAX('Date Chrgback'[CHGBACK DAY OF MONTH])))
Hi prices35,
To calculate the cumulative total for the "Every Chargeback" column, you can create a measure like below:
Cumulative Every Chargeback = CALCULATE(SUM('Date Chrgback'[Every Chargeback]),FILTER(ALL('Date Chrgback'),'Date Chrgback'[CHGBACK DAY OF MONTH]<=MAX('Date Chrgback'[CHGBACK DAY OF MONTH])))
Best Regards,
Qiuyun Yu
4 Replies
- v-qiuyu-msftCommunity Support
Hi prices35,
To calculate the cumulative total for the "Every Chargeback" column, you can create a measure like below:
Cumulative Every Chargeback = CALCULATE(SUM('Date Chrgback'[Every Chargeback]),FILTER(ALL('Date Chrgback'),'Date Chrgback'[CHGBACK DAY OF MONTH]<=MAX('Date Chrgback'[CHGBACK DAY OF MONTH])))
Best Regards,
Qiuyun Yu- AnonymousNot applicable
It works but if you want filter by antother field doesn't work, for example if I add a month name column =
switch ([CHGBACK DAY OF MONTH]
, 1
,"January"
,2
,"February"... etc )
How can I do that ?
Regards
- ewuchatkaHelper II
Thanks for this very helpful post. Did you manage to figure this out? I'm looking for exactly the same solution e.g. managed to do the cumulative sum for all data but if I filter on the data (e.g. on the cost centre), it doesn't calculate the cumulative appropriately.