Take a Look at My "Time" Articles ...
Hi:
Lots of info surrounding what you need, with multiple working examples, in these articles:
http://www.databasejournal.com/featu...-Functions.htm
MDX Time Series Functions, Part II: The OpeningPeriod () and ClosingPeriod() Functions
MDX Time Series Functions, Part III: The LastPeriods() and ParallelPeriod() Functions
Also, many other articles in my monthly MDX Essentials column deal with MDX time functions.
HTH. Let me know if I can answer further questions.
Bill