Forum Discussion
How to write a DAX for cummulative that does not Reset
How do I create a cummulative member column for the set of data below.
Meaning what I should be getting is 2019-12 is 315, 2020-1 is 1,116 and then 2020-2 is 1,414 and so forth.
echow
Add a new column as :This is the new Measure:
Modified Measure.Measure = CALCULATE( COUNT('Table'[VALUE]), FILTER(ALL('Table'),'Table'[YEARMON]<=MAX('Table'[YEARMON]) ))________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
9 Replies
- amitchandak
Super User
echow , Try like with date table
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.- echow
Helper II
Thanks amitchandak
What happen if I want to do it using Year, Month instead of date?
The row of my table is in the order of Year,Month
- Fowmy
Super User
echow
Try this measureMeasure = CALCULATE( COUNT('Table'[VALUE]), FILTER(ALL('Table'),'Table'[YEAR]<=MAX('Table'[YEAR])&& 'Table'[MONTH]<=MAX('Table'[MONTH])) )________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂