Calculating rolling average velocity for each sprint

Hello Team ,

I have a requirement wherein I want to publish the rolling average velocity for each sprint that is part of my calculated member " last 6 sprints ".

For ex : Sprint 1 to Sprint 6 are my last 6 sprints. Then the report should look like

Avg vel. for Sprint 1 = story points completed in sprint 1

Avg vel for Sprint 2 = (sum of story points completed ( Sprint 1 + Sprint 2 )) / 2

And so on …