I have some data that I calculate the average for but I only need to display for the current month. I have a standard date table connected to the data table. Some sample data with result look like this:
The code I am using with some comments about how I think it is working:
Avg Amnt = CALCULATE(
CALCULATE( //Filter the data to just AU currency before Average Calc
//get the previous 3 months data excluding current month
DATEADD ( FIRSTDATE ('Date'[Date] ), -3, MONTH ),
DATEADD(LASTDATE ('Date'[Date]),-1,MONTH )
//Add this for 3 mths average
But I know DAX may not being working the way I think it is.
I tried to wrap another Calculate around the output and filter for just the Current Month by adding from the Date Table ,FILTER('Date', 'Date'[Month #] = 9)) but I get an odd result.