Forum Discussion
Running Total with Date Slicers
I am trying to show a running total that is affected by a date range slicer. It's all working as expected for the maximum date, but I'm having trouble getting the minimum date to filter correctly. Here's a simplified example file
The formula I'm trying to use is:
| Date | Sales | Running Total |
| 1/1/2022 | 5 | 5 |
| 1/2/2022 | 4 | 9 |
| 1/3/2022 | 4 | 13 |
| 1/4/2022 | 4 | 17 |
| 1/5/2022 | 5 | 22 |
| 1/6/2022 | 8 | 30 |
| 1/7/2022 | 3 | 33 |
| 1/8/2022 | 6 | 39 |
| 1/9/2022 | 4 | 43 |
| Date | Sales | Running Total |
| 1/6/2022 | 8 | 8 |
| 1/7/2022 | 3 | 11 |
| 1/8/2022 | 6 | 17 |
| 1/9/2022 | 4 | 21 |
How can I modify my formula to do that? Thanks in advance.
6 Replies
- Ashish_Mathur
Super User
- ELW
Advocate II
Thank you! Your solution appears to work perfectly so far!
- Ashish_Mathur
Super User
You are welcome.
- bm_dataFrequent Visitor
I downloaded the PBI and saw how you were able to get the data in a table and that is extremely helpful. I am trying to do something similar but with a card visualization. The slicer is a list of months and when I click on March, I would like to see the running total from the beginning of the year until the end of that month. I tried using TOTALYTD but was unable to get it to work properly with the slicer. I was only able to pull the total up to current time.
- Ashish_Mathur
Super User
Hi,
This measure should work
=calculate(sum(Data[Amount]),datesbetween(Calendar[Date],date(year(min(calendar[Date])),1,1),max(Calendar[Date])))
Ensure that you have a slicer for Month name and Year (both from the Calendar Table). Select a year and month.