Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
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 |
Thanks in advance
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...
Help when you know. Ask when you don't!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
32 | |
15 | |
14 | |
13 | |
9 |