Generating sum of rolling data using the Lag function

Rolling Data also known as Moving average is a time-based calculation to get an insight into trends for a defined period of time.
If the time frame for the moving average is 12 months, the data that is 13 months old be dropped and the new month’s data will be added.