Hi, this is a one solution to your problem.
You can use parameters and calculative field too, other than filter or combination of both.
I used combination of both. ( I used color shelf to show the data from past n months. you can use size or shape shelf too)
1. Add a parameter to take the N value. (set the range to be from 1-12)

2. Add a calculative field with text like this. (here the data for n months of only present year will be shown)

3. This is a sample i used to show the data for past N months.

4. Drag the calculated field "Orders from past N months" to color shelf to show the difference. You can now enter N value.

5. you can see the data for past n months from color difference.
Hope this helps you.
Happy Learning.