cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Anonymous
Not applicable

## Fill forecast period only off next month value

Hello smart people,

New to Power BI and trawling a tonne of useful content here.

I've created a simple forecast as shown in table below based on avg. last 3 months, and wish to fill the entire year's projection based on just next month's forecast value.

So for example, next month (Feb-20)  is forecast 228, but the months after this decay to zero based on the 3 month lookback.

How would I create the final column to be cumulative dynamically  as we roll through the year (i.e. actual YTD + fill down next month forecast)?

My Excel mind is considering an IF formula based on a blank value in Actual but I suspect I'm way off track!

 Month Actual Forecast (3 mnth avg.) Required MoM Required cumulative Oct-19 383 337 Nov-19 263 356 Dec-19 171 320 Jan-20 250 272 Feb-20 228 228 478 Mar-20 140 228 706 Apr-20 83 228 934 May-20 228 1162 Jun-20 228 1390 Jul-20 228 1618 Aug-20 228 1846 Sep-20 228 2074 Oct-20 228 2302 Nov-20 228 2530 Dec-20 228 2758

Solution Sage

Your Excel mind is part of the way there.

If you are saying that you want to fill down the last forecast based on having 3 previous month's data, then you could use something like COUNTAX() which counts non blank rows. If you count the nonblank rows in the last 3 months of actuals and the count does not = 3, then know you have gone past your actual data

you can then use LASTNONBLANK to find the last month that had actuals and calcualte the 3 month average based on the month that follows that last month

and that will fill down the last average that had 3 previous months to calculate on

The big difference from EXCEL is that DAX has no native concept of the order of the rows, so you can refer directly to values in the next row, or the previous rows, or the previous 3 rows...
You can get a reference to the current row context and get the date value for example, and then use that date value to calculate the COUNTAX over the previous 3 months...

So the various tricks amount to thinking about posing DAX "questions" in terms of column values.
If you'd like help with the DAX then perhaps you could post the measure or calculated column you're using to calculate the the forecast now...

Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!

Join the conversation at We Talk BI find out more about me at Slow BI

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors