0
votes

I'm trying to put togethr an automatic MDX filter in PowerPivot. I have a dimension:

enter image description here

Essentially I need to write a MDX statement where it will pull all records with the Year Month Day >= 90 days prior to today's date. I tried using LastPeriods but I couldn't get that to work. Any thoughts?

1
what does a member of year month day look like? [Time].[Year Month Day].[2013/12/28]?mmarie

1 Answers

2
votes

Here is a set containing the last 90 days from today:

with set [Last 90 days] as 
{StrToMember("[Date].[Date].[" + Format(now(), "yyyyMMdd") + "]").lag(89): StrToMember("[Date].[Date].[" + Format(now(), "yyyyMMdd") + "]")}

I used the lag function.