I'm a little confused on what you are looking to do. Could you provide the community some pictures/attached workbook of what you are trying to do?
As far as moving average for price change, you're in luck! Tableau already has a moving average calculation. Have you tried doing this to your measure?
I hope this starts moving you in the right direction!
What I am trying to do is to identify the month that the price change occurred in(which I have in a measure). Then be able to compare that moving average of volume of that month with the volume of the most recent month that we have complete data for(November). I want to be able to see if a change in price has affected our change in volume. In the example, Product B had a change date on October 1st. I want to be able to take the moving average of volume from the previous 6 months from that date(I do have that part), and then compare it to what the volume was in November. Hopefully it will tell me whether or not the change in price had an effect on volume.
In the picture, Volume is quantity filled.