Forum Discussion

garcia_mars's avatar
garcia_mars
Frequent Visitor
8 years ago
Solved

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 averag...
  • v-chuncz-msft's avatar
    8 years ago

    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] ) )
        )
    )