Forum Discussion
Cumulative Column based on month and Feature
Hi
Very new still to PowerBI and Dax. I've been searching for a few days to work out how to get a Running Total (Cumulative) added to my data after loading
Example below
What I'm hoping you can see (highlghted below) is that I want to get a total figure on each tow for the Impact Time in the month for each feature (in this example Feature "1" has 4 issues and is affected for 5, 7, 13, 19 minutes - totalling 44; Feature "2" has 2 issues and is affected for 1, 35 minutes - Totalling 36)
| Month | Feature | ImpactTime | Running Total |
| Jan-20 | 1 | 5 | 44 |
| Jan-20 | 2 | 12 | 12 |
| Jan-20 | 3 | 1 | 36 |
| Jan-20 | 1 | 7 | 44 |
| Jan-20 | 1 | 13 | 44 |
| Jan-20 | 4 | 20 | 20 |
| Jan-20 | 3 | 35 | 36 |
| Jan-20 | 1 | 19 | 44 |
| Feb-20 | 1 | 10 | 80 |
| Feb-20 | 1 | 27 | 80 |
| Feb-20 | 1 | 43 | 80 |
It's probably very easy to do but I'm not able to understand from the other suggestions in the forum how to apply it so need to specifically ask for my scenario
Thanks in advance
Hi,
This calculated column formula works as well
Running total = CALCULATE(SUM(Data[ImpactTime]),FILTER(Data,Data[Month]=EARLIER(Data[Month])&&Data[Feature]=EARLIER(Data[Feature])))Hope this helps.
3 Replies
- vanessafvgCommunity Championyou can give this a try. you will need to create a date table if you dont have oneiedate = calendarauto () (paste that into a new table)for the new measurerunning_total =var mxdt = max('date'[Date])var fstdt = min('date'[Date])var lst = CALCULATE(max(cummulativetotal[Month]), REMOVEFILTERS())var result = if(fstdt <= lst, CALCULATE(sum(cummulativetotal[ImpactTime]), 'date'[Date] <= lst)) return result
- ryan_mayuSuper User
maybe you can try to create a column
Column = CALCULATE(sum('Table'[ImpactTime]),ALLEXCEPT('Table','Table'[Month],'Table'[Feature])) - Ashish_MathurSuper User
Hi,
This calculated column formula works as well
Running total = CALCULATE(SUM(Data[ImpactTime]),FILTER(Data,Data[Month]=EARLIER(Data[Month])&&Data[Feature]=EARLIER(Data[Feature])))Hope this helps.