--- title: "MovingAverage" slug: "movingaverage" updated: 2023-03-20T10:52:02Z published: 2023-03-20T10:52:02Z canonical: "docs.datajet.app/movingaverage" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # MovingAverage Calculates a moving average across a configurable number of rows ### Purpose Use this function to: - Calculate rolling averages for various intervals ### Parameters ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1679309171868.png) | Parameter | Description | | --- | --- | | Column Name | The name of the output column | | Column | The source column to use when calculating the MovingAverage | | Interval | The number of rows to include in the average. - If Interval = 2, Avg = [Row(X) + Row(X-1)] / 2 - If Interval = 3, Avg = [Row(X) + Row(X-1) + Row(X-2)] / 3 | | Plot Axis | 0 / 1. Y-Axis to use when plotting graph. Default = 0 | | Plot As | Bar / Stacked Bar / Line / Spline / RangeLow / RangeHigh / CSLow / CSHigh / CSOpen / CSClose Determines the graph style for the output column. | | Plot | Y / N. Specifies whether measure’s output column should be plotted on graph. Default = Y | | Popup Mode | Default / None / Extended | | Prefix | £ / $ / E / % | ### Examples ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1679309200047.png) MovingAverage is a more flexible version of [Post Function 7avg](https://datajetsoftware.atlassian.net/wiki/spaces/ED/pages/489259088). Whereas 7avg always calculates intervals of 7, MovingAverage can be used to calculate other intervals. ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1679309241338.png)