Are your variable something like that ? :
vM = month(today())
vY = year(today())
VY1 = year(today()-1)
If it's that, may be when you select specific month in your filter pan your mesure still send back curent month rather than selected month ?
may be try like this :
so that without selection your mesure and set analysis will take as month the last month of the max year in your data
if you select one or several month , your mesure will take as month the max month of your selected month and same with vY1 that will send back the previous year of the selected year or with no selection the previous year of your max year presents in your database.
Hope it's help