Forum Discussion
Date Groupings - 4 Week Increments
- 5 years ago
Hi ryan_b_fiting ,
First go to query editor >create an index column;
Then create 2 columns as below:
rankx = RANKX(FILTER('Table',MOD('Table'[Index],4)=0),'Table'[Index],,ASC)4 Wk Ended = var _mindate=CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[rankx]=EARLIER('Table'[rankx]))) Return _mindate+21And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi -
Thanks for the suggestions everyone. However, I do not think I explained my situation properly.
With my example below, what I will need to happen is when I add a new week of data (4/8/2018 in this example), all the 4 week periods shift so that the most recent always has 4 weeks bucketed into it.
So if I added the 4/8/2018 data the buckets should be reflected as this:
| Time | 4 Wk Ended |
| 1/14/2018 | 1/14/2018 |
| 1/21/2018 | 2/11/2018 |
| 1/28/2018 | 2/11/2018 |
| 2/4/2018 | 2/11/2018 |
| 2/11/2018 | 2/11/2018 |
| 2/18/2018 | 3/11/2018 |
| 2/25/2018 | 3/11/2018 |
| 3/4/2018 | 3/11/2018 |
| 3/11/2018 | 3/11/2018 |
| 3/18/2018 | 4/8/2018 |
| 3/25/2018 | 4/8/2018 |
| 4/1/2018 | 4/8/2018 |
| 4/8/2018 | 4/8/2018 |
I cannot get that to happen with the solutions below. Are there any suggestions to get this to work?
Thanks in advance for all the help!