Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I have a scenario which requeried rolling forcast for the next three years. Please see the sample data below
Jan-22 | 34.69 |
Feb-22 | 86.72 |
Mar-22 | 64.75 |
Apr-22 | 52.9 |
May-22 | 45.37 |
Jun-22 | 45.9 |
Jul-22 | 47.27 |
Aug-22 | 44.83 |
Sep-22 | 44.86 |
Oct-22 | 43.5 |
Nov-22 | 40.49 |
Dec-22 | 37.69 |
Logic for forecasting is for Jan 23, Average of (Jan 22 to Dec 22), Feb 23 is Average of (Feb 22 to Jan 23), Mar 23 is Average of (March 22 to Feb 23) like this upto Dec 25 we need to iterate.
I got a solution in Power Query. But it would be great if there any Dax solution for this.
Thanks in Advance,
VP
Finding a non-recursive formula for this problem, even though possible, will be very, very tedious. Sadly, you can't use recursion (which would make this very easy) because DAX does not support recursion 😞
you may try
Rolling Forcast Average =
VAR CurrentDate =
MAX ( 'Date'[Date] )
VAR CurrentYear =
YEAR ( CurrentDate )
VAR LastDateWithSales =
CALCULATE ( Sales[Date], REMOVEFILTERS () )
VAR NumberOfDays =
CALCULATE ( COUNTROWS ( 'Date' ), REMOVEFILTERS (), 'Date'[Year] = CurrentYear )
VAR LastDate = CurrentDate + NumberOfDays
VAR Result =
IF (
CurrentDate <= LastDateWithSales - 365,
CALCULATE (
[Sales Amount],
REMOVEFILTERS ( 'Date' ),
'Date'[Date] <= LastDate,
'Date'[Date] > CurrentDate
)
)
RETURN
Result
Thank You!! But the rolling forecast is not happening with this query.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |