Thank you for your quick responses. Here is a sample. I am trying to calculate monthly average demand by ItemID. I did it by Avg Demand: sum(salesqty)/[active months].
Average w Aggrgate: avg(aggr(sum(SalesQty),MonthYear)) does not work.
Std Dev of Demand: Stdev(aggr(sum(SalesQty),MonthYear)) does not work either. I want to calculate the deviation of the monthly sums.
I believe you also need to add ItemID as a dimension in your aggr() expressions:
Your file updated with these changes is also attached. It's definitely working for the average. You'll have to figure out if it's working properly for the standard deviation.