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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
garcia_mars
Frequent Visitor

Forecasting future months using previous months data on a fiscal period

Hi,

 

I need some help on creating a measure to calculate a forecasted monthly value using the average of the prior months in the fiscal year. The result showing in my table isnt the correct average. I am wondering where it is coming from. I used the below formula:

 

Average Corp Card Spend = AVERAGEX(
    VALUES('Calendar Dates'[Month/Year]),
    CALCULATE(AVERAGE('Actual Spend'[Corporate Card Spend]))
)

 

And also, i want it to appear only on the months which have blank actual corp card values (in the example: June-Oct only)

 

2018-07-21_0-03-26.jpg

 

I've also tried the following formula but didnt work to:

Average Corp Card Spend = AVERAGEX(
    VALUES('Calendar Dates'[Fiscal Year]),
    CALCULATE(AVERAGE('Actual Spend'[Corporate Card Spend]))
)

 

the result became:

Appreciate the help!2018-07-21_0-10-59.jpg

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@garcia_mars,

 

You may try CALCULATETABLE Function and ALLEXCEPT Function as shown below.

 

Measure =
IF (
    ISBLANK ( SUM ( 'Actual Spend'[Corporate Card Spend] ) ),
    AVERAGEX (
        CALCULATETABLE (
            VALUES ( 'Calendar Dates'[Month/Year] ),
            ALLEXCEPT ( 'Calendar Dates', 'Calendar Dates'[Fiscal Year] )
        ),
        CALCULATE ( SUM ( 'Actual Spend'[Corporate Card Spend] ) )
    )
)

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@garcia_mars,

 

You may try CALCULATETABLE Function and ALLEXCEPT Function as shown below.

 

Measure =
IF (
    ISBLANK ( SUM ( 'Actual Spend'[Corporate Card Spend] ) ),
    AVERAGEX (
        CALCULATETABLE (
            VALUES ( 'Calendar Dates'[Month/Year] ),
            ALLEXCEPT ( 'Calendar Dates', 'Calendar Dates'[Fiscal Year] )
        ),
        CALCULATE ( SUM ( 'Actual Spend'[Corporate Card Spend] ) )
    )
)

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Works perfectly! thankyou @v-chuncz-msft

@v-chuncz-msft

Need your further help...

 

Just realized it doesnt show any totals for that column.  How would i total them?

 

And also, I wanted to create a total (actual +forecasted) column - I did the below measure and it works on the row level, but the grand total included only the actual value.

 

2018-07-26_12-46-09.jpg

 

Actual + Forecasted = [Total Corp Card Spend]+[Forecasted Monthly Corp Card Spend]

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.