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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
TK12345
Resolver I
Resolver I

Forecast based on variables and switching between forecast and actual revenue

I am making a forcast for the upcomming months, but i can't really get it in Power BI.
I am trying it with some variables but it does not work yet. I would like to make the measure for the Revenu.
But the dificult part is that today we are in month 11, so we need to have our Revenu forcast based on the ACTUAL Revenu of Month 10 (oktober)
So when we are still in month 11, the revenu forcast for februari is still based on Januari that is based on forecast december and that one is based on
forecast november and that one is based on ACTUAL Oktober. But when we are in December next month we do have the actuals for November and then
all the forecasts needs to look at the actuals of november. So the november will be orange as well.


So at the start of the month all the forecasts needs to change because we need to have our forecast look at our last whole month revenue. Please see atached. https://1drv.ms/x/s!ArweH82sfYtEnFDgk9wCrDhzVTST?e=8caRnq 

Please help me out. 
So the forecast of the first upcoming month is based on the ACTUAL REVENUE last month. And the forecasts months after the first one are based on the forecast of the previous month. 

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @TK12345 ,

I created some data:

vyangliumsft_0-1637909664114.png

Here are the steps you can follow:

1. Create a calculated column in Table.

Table_column =
var _loss=CALCULATE(SUM('Table'[Loss]),FILTER(ALL('Table'),[date]<=EARLIER('Table'[date])))
var _rev=CALCULATE(SUM('Table'[Pot.Rev]),FILTER(ALL('Table'),[date]<=EARLIER('Table'[date])))
return
IF([Revenu Forecast]=BLANK(),600000+_rev-_loss,[Revenu Forecast])

vyangliumsft_1-1637909664116.png

2. Enter the power query, copy the Table to form a new table Unpivot Table

vyangliumsft_2-1637909664118.png

3. Select [Revenu Forecast],[Loss],[Pot.Rev],[Marge IN], [Marge IN.1] in the Unpivot Table in the New table, and click Transform – Unpivot Columns.

vyangliumsft_3-1637909664121.png

Result:

vyangliumsft_4-1637909664122.png

4. Create a calculated column in the Unpivot Table.

Expected =
IF([Attribute]="Revenu Forecast",CALCULATE(SUM('Table'[Table_column]),FILTER(ALL('Table'),[Attribute]="Revenu Forecast"&&[date]=EARLIER('Unpivot Table'[date]))),[Value])

5. Result:

vyangliumsft_5-1637909664123.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi there, thanks for your reply!
It almost helps! But important to know is that I don't have the measure [Revenue Forecast] or column. Those are based on my last whole month revenue. 

So I have a measure for the Potentional loss per month, a measure for the potentional Revenue per month, and the last known whole Revenue. So my forecast is not empty for other months, it just has to be made and based on my last known revenue. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.