Forum Discussion
Anonymous
5 years agoNot applicable
Calculating a MTD Average based on Date and Entity
Hello,
I have a table with a number by person by date. I want to calculate the average for current month/month(s) previous.
I've tried 2 calculations, neither work:
- Average#MTD = Averagex(values(Table[Date].[Date], [Number]) - returns the Number for each Month
- Average#MTD= CALCULATE(AVERAGEX(Table,Table[Number]),Filter(Table,Table[Date].[Date]<=EARLIER(Table[Date].[Date]))) - gives me the average by date, but not to specific person (UniqueID2).Do I just need another filter here?
Understand the preference is to provide a pbix file. I unfortunately am not able to do that. Appreciate any help anyone is willing to provide without pbix files. I am very close to getting to what I need, but am missing something small I think..
Anonymous - Are these calculated columns or measures? Look like calculated columns. Try:
Average#MTD= AVERAGEX(Filter(Table,Table[Date].[Date]<=EARLIER(Table[Date].[Date] && [Name]=EARLIER(Table[Name])),Table[Number])
2 Replies
- Greg_Deckler
Community Champion
Anonymous - Are these calculated columns or measures? Look like calculated columns. Try:
Average#MTD= AVERAGEX(Filter(Table,Table[Date].[Date]<=EARLIER(Table[Date].[Date] && [Name]=EARLIER(Table[Name])),Table[Number])- AnonymousNot applicable
Yepp! That did it - THANK YOU very much for the help!