title: MDX Get Sales starting from 2 years ago to today
body: <p>I'm trying to make a dynamic report that pull sales starting from the first day of the fiscal year 2 years ago up to today and rolls forward with each new fiscal year. Our fiscal years don't line up with  calendar years.
  I have little MDX experience and am still learning.</p>
  <p>So it should look at todays date, get the current fiscal year, subtract 2 years from it and then pull sales starting from that year up to today.</p>
  <p>I had some difficulty just trying to get the date working correctly as I was getting errors however the below query now pulls yesterdays sales for me. I assume I need to reference [Date].[Year] as well, but I don't know how to use it to get my desired results.</p>
  <pre><code>SELECT 
  NON EMPTY 
  { [Measures].[Gross Margin Percentage], 
  [Measures].[Gross Margin Value], 
  [Measures].[Sales Value], 
  [Measures].[Sales Units] } 
  ON COLUMNS
  
  FROM IMR
  
  Where     
  {StrToMember(&quot;[Date].[Date].&amp;&quot; + Format(CDate(now()-1), &quot;[yyyy-MM-ddT00:00:00]&quot;))}
  </code></pre>