Adjust x-axis to past months 1-12

Hi,
I have a line chart with current sales and sales of last year as values. Now, I want that chart only visualizes the data from the past 12 months. However, if I use a filter for year->current year only, my self-calculated field ‘sales of last year’ is not shown anymore. The field is calculated with periodOverPeriodLastValue(sum({Sales}), Date YEAR, 1. Anyone an idea how to limit the visualization to the current year without loosing the data values of ‘sales of last year’?

Have you tried to define your filter with parameters?


Thank you, yes, I tried filtering with parameters. They work fine but I keep having the problem that they basically filter before the field ‘sales of last year’ is created and, therefore, it is not displayed in the chart. This is how it looks like without the filter (blue is current sales and orange is sales of previous year):
image
And after filtering based on the parameters (14 months), it only shows me the values of the previous year for the last two months that are covered by the first two months of the shown period.
image

I noticed the graph will work with the parameter based filter if you have month over month comparison instead of year. It has something to do with the filter and graph is based out of month.

After changing the x-axis to year and filter with last 36 months, it appears working to me. If you filer 12 months only, then there is only one data point shown for prior year.