Forum Discussion
kenj
3 years agoFrequent Visitor
dax
I'm Unable to calculate moving/running average using Average Cost moving = AVERAGEX ( WINDOW( 1,ABS, 0,REL, SUMMARIZE(ALLSELEC...
- 3 years ago
I think the problem is the sort order, you're sorting by month name but I think you want to sort by month number. try
Average Cost moving = AVERAGEX ( WINDOW ( 1, ABS, 0, REL, SUMMARIZE ( ALLSELECTED ( 'Custom Calendar Table' ), 'Custom Calendar Table'[FY], 'Custom Calendar Table'[Month Name], 'Custom Calendar Table'[Month number] ), ORDERBY ( 'Custom Calendar Table'[FY], ASC, 'Custom Calendar Table'[Month Number], ASC ) ), [Actual Cost] )
johnt75
3 years agoSuper User
I think the problem is the sort order, you're sorting by month name but I think you want to sort by month number. try
Average Cost moving =
AVERAGEX (
WINDOW (
1,
ABS,
0,
REL,
SUMMARIZE (
ALLSELECTED ( 'Custom Calendar Table' ),
'Custom Calendar Table'[FY],
'Custom Calendar Table'[Month Name],
'Custom Calendar Table'[Month number]
),
ORDERBY ( 'Custom Calendar Table'[FY], ASC,
'Custom Calendar Table'[Month Number], ASC )
),
[Actual Cost]
)