Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Norbertus123
Frequent Visitor

moving average also to the future

Hi,

i have the next simple table:
01-01-2024 => 4

01-02-2024 => 6

01-03-2024 => 5
01-04-2024 => 8

Now i want the next solution

* for periode 01-05-2024 the average of the last 3 months (6+5+8)/3 = 6.33
* for periode 01-06-2024 the average of (5+8+6.33)/3 = 6.44
* for periode 01-07-2024 the average of (8 +6.33 + 6.44)/3 = 6.93
* for periode 01-08-2024 the average of (6.33+6.44+6.93)/3 = 6.56

end so on. Is that possible?

 

with kind regards

 

Norbertus

2 REPLIES 2
Norbertus123
Frequent Visitor

hi @rajendraongole1  Thanks for your reaction. This solution gives not exactly what i hoped for:

For period 5 i want the moving average of period 2 + 3 + 4

For period 6 i want the average of period 3 + 4 + moving average period 5

For period 7 i want the average of period 4 + moving average period 5 + moving average period 6

For period 8 i want the average of moving average period 5 + moving average period 6 + moving average period 7 

* for periode 01-05-2024 the average of the last 3 months (6+5+8)/3 = 6.33 
* for periode 01-06-2024 the average of (5+8+6.33)/3 = 6.44
* for periode 01-07-2024 the average of (8 +6.33 + 6.44)/3 = 6.93
* for periode 01-08-2024 the average of (6.33+6.44+6.93)/3 = 6.56

rajendraongole1
Super User
Super User

Hi @Norbertus123 - Calculate a rolling average in Power BI that incorporates forecasted values for future periods based on the average of the last three months

base measure to calculate the sum of sales

TotalSales = SUM('Financials'[Sales])

Create a measure to calculate the rolling average of the last three months.

RollingAverage3Months =
VAR CurrentDate = MAX('Financials'[Date])
VAR RollingAverage =
AVERAGEX(
DATESINPERIOD(
'Financials'[Date],
CurrentDate,
-3,
MONTH
),
[TotalSales]
)
RETURN
RollingAverage

 

Create rolling average for forecasted periods measure

ForecastedRollingAverage =
VAR CurrentDate = MAX('Financials'[Date])
VAR Last3Months =
CALCULATETABLE(
TOPN(3,
ADDCOLUMNS(
SUMMARIZE('Financials', 'Financials'[Date]),
"Sales", [TotalSales],
"RollingAvg", [RollingAverage3Months]
),
'Financials'[Date], DESC
),
FILTER('Financials', 'Financials'[Date] < CurrentDate)
)
VAR AvgLast3Months =
IF(
COUNTROWS(Last3Months) < 3,
BLANK(),
AVERAGEX(Last3Months, [RollingAvg])
)
RETURN
IF(
CurrentDate <= MAX('Financials'[Date]),
[RollingAverage3Months],
AvgLast3Months
)

 

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.