Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nakuldev
Creator
Creator

Rolling N months

Hi All,

In MonthYear filter, if I select Nov-2019, chart should show data for previous month i.e; Oct-2019, like wise if I select 3 months (Nov-2019,Oct-2019 and Sep-2019) then the same chart should show data for previous three months i.e; (Jun-2019,July-2019 and Aug-2019). 

Appreciate the support in advance.

Thanks

Nakul

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Here is what you can try

=Sum({<MonthYear = {">=$(=Date(MonthStart(Min(MonthYear), -GetSelectedCount(MonthYear)), 'MMM-YYYY'))<=$(=Date(MonthStart(Max(MonthYear), -GetSelectedCount(MonthYear)), 'MMM-YYYY'))"}>}Sales)

Basically, as long as you select the all the months between start and end, you can go back the number of MonthYear selected from the Min and Max MonthYears selected.

image.png

View solution in original post

5 Replies
sunny_talwar

If you select Jan-19 to Oct-19 which is 10 months... you would want to see Mar-18 till Dec-18?

nakuldev
Creator
Creator
Author

Hi Sunny! 

Thank you for quick reply. Yes! If we select Jan-19 to Oct-19 which is 10 months... you would want to see Mar-18 till Dec-18.

If not at least for the same year (max upto 4 months) will be fine. 

Thanks 

Nakul 

sunny_talwar

Here is what you can try

=Sum({<MonthYear = {">=$(=Date(MonthStart(Min(MonthYear), -GetSelectedCount(MonthYear)), 'MMM-YYYY'))<=$(=Date(MonthStart(Max(MonthYear), -GetSelectedCount(MonthYear)), 'MMM-YYYY'))"}>}Sales)

Basically, as long as you select the all the months between start and end, you can go back the number of MonthYear selected from the Min and Max MonthYears selected.

image.png

Brett_Bleess
Former Employee
Former Employee

Nakul, it looks like Sunny's last post likely got you what you needed, if that is the case, please be sure you circle back to the thread and use the Accept as Solution button on his last post if that did the trick.  This gives him credit for the help and lets other Community Members know his solution actually worked for your use case.  If you still need further help, leave an update for us.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
nakuldev
Creator
Creator
Author

Thank you Sunny! Sorry for the delay.

Regards

Nakul