This things need to be done with the indexes and not with filters as you need previous ranges for calculating the moving average by whatever months you required. Please find the attached image below for reference. I have done this on the superstore data. Also refer the twbx 9.3 which is attached.
I hope this helps you.
Thanks and Regards,
Moving average.twbx 321.1 KB
Thank you very much! your answer is really helpful, and i do get what I need!
But I didn't understand why the filter combination of "calculation1"(less than selecte month) and "Calc_filter"( use Last() function for table calculation) can get right answer, but my "isSelectedMonth" got wrong data. Why the Last() function can only show specific data and "Hide" other data in RAM?
Anyway, I already know how to do it, but just curious why your solution can work.
Here you are using Parameter to get the month, but in my situation I need to use the filter as parameter does not update automatically.