Moving average in Power BI

If you work with monthly figures, weekly results, or other time series, you will recognize this. One period shoots up, the next drops, and before you know it, you can no longer see the trend through the fluctuations. A moving average helps you bring calm to the data and reveal the real pattern. In this blog, I will take you step by step through the logic, the calculations, and the visual. I will also show you how to apply the moving average in a margin dashboard.

A moving average is ideal when your data fluctuates significantly from month to month and you want to understand where the whole is heading. Think of revenue that varies greatly from month to month, costs that peak due to a one-off invoice, or lead inflow that varies from week to week. By taking an average over, say, six months, you get a much more stable picture. This allows you to see not only what is happening, but also whether there is growth, stabilization, or decline. It makes trend analysis more reliable and helps you make better decisions.

Clearly recognize trends

Ignore peaks and troughs and focus on the longer-term trend.

Strengthen signals for decision-making

A moving average makes it easier to compare periods.

1. The line visual
Copy the line visual we just created in section 1 and paste it into the empty box

2. The MIN function
Go to “New data visualization calculation”
Click on “Custom”
Enter the following:

3. The MAX function
Go to “New data visualization calculation”
Click on “Custom”
Enter the following:

4. Formatting the MIN & MAX function
Go to “Format visual” and select “Lines.”
Select the MIN & MAX lines and disable them.

5. Bandwidth bar
Go to “Add further analyses to your visual.”
Click on “Add rule” and add:

MAX: value = MAX
MIN: value = MIN

Select the following for both constants:
Color: light gray
Transparency% = 100%
Position: Behind

Select the MIN constant and:
enable give area a dark tint
Position: Front
Color black
Transparency% = 0%

Select the MAX constant and:
switch on give area a dark tint in
Position: Front
Color: light gray
Transparency% = 80%

A moving average is most powerful when it is used in the right type of line chart. The way your data is displayed has a direct impact on how trends are perceived and interpreted.

In the module Line Chart Variants in Power BI I explain the differences between line charts, area charts, stacked area charts and 100% stacked area charts. You’ll learn when each variant adds clarity and when it can actually distort the story. This helps you understand not just how to calculate a moving average, but also when it truly adds analytical value.