Actually, pretty much tough request because aggregated value is used as criteria..
Here is one example.
I tried table calc but it was too much troublesome or not maintenanceable.
Instead, reshaped data source.
1st : Self Join the data with Range join to specify the last 5 month to this month relatively.
Filter out future date.
Thanks Shin for your efforts, although it's a good workaround, but for my real data it will be almost impossible. Large dataset which when self union will be slower processing. Also i still need to do 3M,6M,9M and 12M rolling, which in the case self join 4 times.
I appreciate your efforts, i will keep this open maybe someone will come up with another solution.
Thanks Shin, At the moment i am doing the Rolling Avg calculations out of tableau using Python. Later i use the output in Tableau.
At the moment using this pre calculated file, gives me a total flexibility to change the date range, metric from current,3,6,9 or 12 rolling on the spot.
I am trying to do it on the fly using Tableau. Your solution is very good in case of smaller datasets, as well as there will be no change of date range. Also with your solution i need to self union 4 times for each metric (3,6,9,12M).