My suggestion would be to perform these kind of calculation at the database end instead of WebI end.
May I know what's the backend being used?? If it is BEx then you can use variable offset option to calculate the 12 month rolling data as well.
http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a563fe09411d2acb90000e829fbfe/content.htm