As I mentioned off-line (I thought I would answer here too incase
someone else is watching this thread), you could do something like:
Quote:
|
AVG(Lastperiods(12,Ancestor([Time].Currentmember,[Time].
|
[Month]).PrevMember),[Measures].[Sales])
If you are on the month level, it will return the current month. If you
are lower than month it will work it's way up the heirarchy to the month
level.
You may want different logic if the user picks a level higher than
month, you could handle that with an IIF() function.
--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell
In article <1142501063.927103.110050 (AT) v46g2000cwv (DOT) googlegroups.com>,
olap (AT) gmsbv (DOT) nl says...
Quote:
Hi,
Thank you this is working for if you choice for example a month but
what would be the MDX code if you choice for example a date 1 feb 2006
and you would like to show always the average of the last 12 periods (=
months).
Regards, Marco |