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
Is my idea (described above) possible by a any means? Or does it have some error in logic I don't realize?
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
- dhannaa9 years agoHelper IV
Thanks again v-jiascu-msft !
This solution worked, I kind of figured it out myself through trial and error :)
I've got one more question, is there an easy answer for this? I can't find one though I am trying hard.
I am trying to achieve this kind of table that tells stock value for any given month. For now I am only getting stock changes as source data is filtered by BI matrix table (and its dates) itself? Is it possible to bypass that filtering with DAX-formula as I want cumulated data from beginning of time, not beginning of month?
Jenny
- v-jiascu-msft9 years agoMicrosoft Employee
Hi Jenny,
I found out that changing "min" into "max" would work.
AccumulatedValue 2 = CALCULATE ( SUM ( Table1[Qty] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) )Best Regards!
Dale
- dhannaa9 years agoHelper IV