Hi Experts,
Can you please please advise and guide me why the moving average gives different result if Calculate is used in SUM and only SUM alone.
Below screenshots are for reference and attached PBIX file for your reference.
and immidiately its visible that second table where you are not using Calculate, gives incorrect answer. and the Key here is the Context Transition. a Key concept in DAX.
AverageX is an itirator function, and when Calculate is used inside of an itirator function, it implements context transition. this is not happening in the second measure
Best way to not incur this situation is to use a measure that calculates sum(GME_Stock_History[Close]).
This measure will work because a measure is always wrapped inside of a calculate as a default property.