Forum Discussion
garcia_mars
8 years agoFrequent 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 averag...
- 8 years ago
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] ) ) ) )
v-chuncz-msft
Community Support
8 years ago
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] ) )
)
)
- garcia_mars8 years agoFrequent Visitor
Works perfectly! thankyou v-chuncz-msft
- garcia_mars8 years agoFrequent Visitor
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.
Actual + Forecasted = [Total Corp Card Spend]+[Forecasted Monthly Corp Card Spend]