Forum Discussion
Running total modification
- Anonymous6 years ago
Hi all,
Unfortunately none of these solutions worked 😞 What I ended-up doing:
- future month as blank: I gave up
- only suming the first line against a repetitive month: I moved the columns in a separate column with no repeats and applied a simple running total measure and created a relationship back to the first table.
THanks all for trying to help 🙂
OF
Anonymous , try the first formula. Or try the second one with a date calendar
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date])
&& 'DI Impact'[DI Impact Type]="Actual"
)
)
Or
DI Impact Actual Running Total = CALCULATE(
SUM ('DI Impact'[DI Impact]),
FILTER (
ALL ('Date'),'Date'[Date] <= MAX ('DI Impact'[Date]))
,'DI Impact'[DI Impact Type]="Actual"
)amitchandak , thank you for the suggestion. You actually gave me the idea to further amend the formula to be more precise.
Unfortunately it still shows numbers for months in the future whereas I was hoping to show "null"
- amitchandak6 years agoSuper User
Try for the future month as 0
DI Impact Actual Running Total = CALCULATE( SUM ('DI Impact'[DI Impact]), FILTER ( ALL ('DI Impact'),'DI Impact'[DI Impact Date] <= MAX ('DI Impact'[DI Impact Date]) && 'DI Impact'[DI Impact Date] <=today() && 'DI Impact'[DI Impact Type]="Actual" ) ) Or DI Impact Actual Running Total = CALCULATE( SUM ('DI Impact'[DI Impact]), FILTER ( ALL ('Date'),'Date'[Date] <= MAX ('DI Impact'[Date]) && 'Date'[Date]<=today() ) ,'DI Impact'[DI Impact Type]="Actual" )- Anonymous6 years agoNot applicable
Hi all,
Unfortunately none of these solutions worked 😞 What I ended-up doing:
- future month as blank: I gave up
- only suming the first line against a repetitive month: I moved the columns in a separate column with no repeats and applied a simple running total measure and created a relationship back to the first table.
THanks all for trying to help 🙂
OF
- camargos886 years agoCommunity Champion
Hi Anonymous ,
You can try this code to calculate running total without group the values before:
CALCULATE(SUMX(Table_2; Table_2[Value] / CALCULATE(COUNT(Table_2[Date]))); FILTER(ALL(Table_2[Date]); Table_2[Date] <= MAX(Table_2[Date])))I hope it helps,Ricardo- Anonymous6 years agoNot applicable
Hi camargos88 , do you suggest I use this formula for my first or second problem? I'm trying to convert it to make it work 🤔
- camargos886 years agoCommunity Champion
Hi Anonymous ,
The second one, this formula handles the duplicated value.
Ricardo