Forum Discussion
Rolling 12 Month Count within a single file, from a folder data source
- 6 years ago
Omg got it! Here's the formula for anyone else that comes across this.
CALCULATE(COUNTA('Report'[Notice Number]),DATESBETWEEN(AxisDateTable[Date],SAMEPERIODLASTYEAR(LASTDATE(AxisDateTable[Date])),LASTDATE(AxisDateTable[Date])))
wetscott - Sorry, having trouble following, can you post sample data as text and expected output?
This might help: https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Months/m-p/391499#M124
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Tried to follow a couple of those, but things just aren't quite lining up. I think there's a problem with the fact i'm trying to do counta on one date column, but only for entries within a single data file.
Here's my sample pbix.
https://app.box.com/s/r54rhft8nt7s5ksekidnisrvcwqz9wvf
Here's a same chart (did a link Painting :P)
https://app.box.com/s/btu286ghuun5nci80g97kk5bb0ovtxmc
| Total This Month | 12 Month Running Total Ending This Month | |
| Sep 19 | 0 | 47 |
| Oct 19 | 5 | 43 |
| Nov 19 | 14 | 57 |
| Dec 19 | 5 | 59 |
| Jan 20 | 0 | 59 |
| Feb 20 | 11 | 70 |
| Mar 20 | 6 | 72 |
| Apr 20 | 5 | 72 |
| May 20 | 2 | 69 |
| Jun 20 | 4 | 69 |
| Jul 20 | 40 | 96 |
| Aug 20 | 10 | 102 |