There are several examples of these sorts of calculations in the Workbook & Calculation Library. You might want to review these to help find the most appropriate example for your situation.
here is a search for that area that should help.
sorry for my late response to your reply
the above link is very helpful
i have another question if you don' mind
i have the scenario to calculate the YoY moving average
can you please provide a reference for moving average YoY growth calculation