Forum Discussion
Moving Average changes when using a Slicer
- Anonymous9 years ago
Moving Average= CALCULATE( AVERAGEX( lineDataClosed, SUM(lineDataClosed[Closed Count])/3 ), ALL(lineDataClosed), DATESINPERIOD( lineDataClosed[Week], LASTDATE(lineDataClosed[Week]), -21, DAY ) )
Try this and let me know the result.
Have a look at the DAX statement you have used to calculate your measures. Dax Statements are context sensitive, meaning that they change their results based on slicers.
You might need to make use of an ALL() style function to tell it to consider all of the information. Its going to be tough to give you a more direct solution because ALL() will avoid every slicer, which you might not want. So you might need to use ALLEXCEPT().
- mshashmi9 years agoFrequent Visitor
Anonymous
Moving Average= CALCULATE(AVERAGEX(lineDataClosed,sum(lineDataClosed[Closed Count])/3),DATESINPERIOD(lineDataClosed[Week],LASTDATE(lineDataClosed[Week]),-21,DAY))
This expression is giving me the result as per now. Where do I need to place All() or ALLEXCEPT() to get the desired result?
Thanks
- Anonymous9 years agoNot applicable
Moving Average= CALCULATE( AVERAGEX( lineDataClosed, SUM(lineDataClosed[Closed Count])/3 ), ALL(lineDataClosed), DATESINPERIOD( lineDataClosed[Week], LASTDATE(lineDataClosed[Week]), -21, DAY ) )
Try this and let me know the result.
- mshashmi9 years agoFrequent Visitor
Anonymous
Thanks a lot