Forum Discussion
dhannaa
9 years agoHelper IV
Cumulative sum
Hi all, I am trying to achiece a stock report that gives stock value per different products for any given date. To achieve this - and other cool things as well - I would like to have a new c...
- 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
TomMartens
9 years agoSuper User
Hey,
first - create a dedicated calendar table with DAX, by using the CALENDAR(...) function, you may also consider using M within your QueryEditor to build the calendar table, but this almost depends on your personal taste
2nd - create a relationship between your table (m-side) and your calendar table (1-side)
3rd - http://www.daxpatterns.com/time-patterns/
hope this gets you started