Forum Discussion
user8289
2 years agoNew Member
How to create a running total column from a certain date range in DAX
I am trying to create a running total of a list of data. I have data from a large date range but only want to create the running total over the last 7 days and next 7 days input: date ...
- 2 years ago
Hi, user8289
Replace the formula with the following:
Running total = Var _Sum=CALCULATE( SUM('table'[size]), FILTER(ALL('table'), 'table'[Date] <= SELECTEDVALUE('table'[date]) &&[Date]>=MIN('Date'[Date])&&[Date]<=MAX('Date'[Date] ))) Return IF(SELECTEDVALUE('Table'[Date])>=MIN('Date'[Date])&&SELECTEDVALUE('Table'[Date])<=MAX('Date'[Date]),_Sum,BLANK())Is this the result you expect? Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
2 years agoSuper User
1. If you create a calculated column the data will be static (won't change on filtering). Make sure that is what you want
2. Read about the WINDOW function and its siblings.