Forum Discussion
Syndicate_Admin
3 years agoAdministrator
Cumulative sum
Hello, I've been having a problem I tell you. I have this table that is a forecast, so I would like to have a measure that adds the accumulated month by month of the quantity column but stops th...
- 3 years ago
Hi Syndicate_Admin ,
Based on your description, I have created a simple sample:
Please try:
Cumulative sum = var _a = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]<=EOMONTH(MAX('Table'[Date]),0))) var _b = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]<=EOMONTH(MAX('Table'[Date]),-1))) return IF(MONTH(MAX('Table'[Date]))=MONTH(TODAY()),_b,_a)Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jianboli-msft
3 years agoCommunity Support
Hi Syndicate_Admin ,
Based on your description, I have created a simple sample:
Please try:
Cumulative sum =
var _a = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]<=EOMONTH(MAX('Table'[Date]),0)))
var _b = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Date]<=EOMONTH(MAX('Table'[Date]),-1)))
return IF(MONTH(MAX('Table'[Date]))=MONTH(TODAY()),_b,_a)
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.