Forum Discussion
Cumulative sum
- 9 years ago
Hi Jenny,
I guess you have a date table in this scenario. Let's call it "Calendar". Then you can try this formula.
AccumulatedValue = CALCULATE ( SUM ( Table1[Qty] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MIN ( 'Calendar'[Date] ) ) )Add a date slicer from "Calendar".
Best Regards!
Dale
Thanks again!
Finally got around my problems mentioned previously. I think there was really an issue with dates.
Still got one more problem in daily stock calculations.
(I will definitely open a new thread when this is solved. I think the problem has to do with original question its solution - and therefore I placed my question here.)
Accumulated value is currently counted like this:
AccumulatedValue = CALCULATE (
SUM ( 'Stock entries'[Quantity] );
FILTER ( ALL ( 'Calendar' ); 'Calendar'[DateKey].[Date] <= MAX('Stock entries'[Posting Date]))
Accumulated value isn't counted in the table below at all if there is no stock movements for that particular date.
(As the trigger for counting is posted line of stock movements and there is none for second day.)
What would be the solution to force counting for this day as well?
Cheers,
Jenny
Hi Jenny,
Is the table your visual or source data? There is no date in it. That's why it didn't work. If you have dates, please try to use the dates from table Calendar. A right relationship is also needed.
Best Regards!
Dale
- dhannaa8 years agoHelper IV
Sorry my picture did not tell it all. It was a visual table and there was a calendar table linked to the fact table (dates of my picture/visual were from calendar table), but there must have been something wrong with the calendar table. I anyway managed to tackle all the mysterious problems by remaking my file. Yes!
Jenny