Forum Discussion
3 Month Average, excluding current month
- 5 years ago
michael_knight , sorry, my mistake. Try like
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ),[Withdrawal %]),
DATESINPERIOD ( 'Date'[Full Date], eomonth ( max('Date'[Full Date]) ,-1), -3, MONTH )
)
michael_knight , Try like
3 Month Rolling Average Fall Through =
IF (
ISBLANK ( [Withdrawals]),
BLANK (),
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ),[Withdrawal %]),
DATESINPERIOD ( 'Date'[Full Date], eomonth ( 'Date'[Full Date] ,-1), -3, MONTH )
)
)
or only
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ),[Withdrawal %]),
DATESINPERIOD ( 'Date'[Full Date], eomonth ( 'Date'[Full Date] ,-1), -3, MONTH )
)
make sure Date is marked as date table
- michael_knight5 years ago
Post Prodigy
Hi amitchandak
I tried both suggestions and got this error
"A single value for column 'Full Date' in table 'Date' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
I made sure to mark Date as a date table too
- amitchandak5 years ago
Super User
michael_knight , sorry, my mistake. Try like
CALCULATE (
AVERAGEX ( VALUES ( 'Date'[Month/Year] ),[Withdrawal %]),
DATESINPERIOD ( 'Date'[Full Date], eomonth ( max('Date'[Full Date]) ,-1), -3, MONTH )
)- michael_knight5 years ago
Post Prodigy
Legend, thank you amitchandak