title: MDX - Calculated MTD measure returning null value
body: <p>I have a Cube with a Date dimension hierarchy (Year,Semester,Quarter,Month,Day).</p>
  
  <p>There are 2 measures available in the datawarehouse. </p>
  
  <pre><code>[AUD DLY] : Daily numbers
  [AUD YTD] : Daily incremental YTD numbers
  </code></pre>
  
  <p>Hierarchy is as follows</p>
  
  <pre><code>Date - Dimension 
  Financial - Hierarchy 
  
  Year - [Date].[Financial].[Year]
  Semester - [Date].[Financial].[Semester]
  Quarter - [Date].[Financial].[Quarter] 
  Month - [Date].[Financial].[Month] 
  Day - [Date].[Financial].[Day]
  
  Measures [AUD DLY]
  Measures [AUD YTD]
  </code></pre>
  
  <p>I need to add a MTD field in the measures such that when the business select a particular date on their slicer in excel for e.g., 3 March 2016, MTD should be calculated as either of the following ways :</p>
  
  <pre><code>1) [AUD MTD] should be calculated by subtracting [AUD YTD] on 
  last day of  previous month from the current selected date. 
  So if we select 3 March 2016 then
  
  [AUD MTD] = [AUD YTD] on 3 March 2016 - [AUD YTD] on 29 Feb 2016
  
  OR
  
  2) [AUD MTD] should be calculated by adding the [AUD DLY] from first day
  of the current month until the selected date in that month. 
  So if we select 3 March 2016 then
  
  [AUD MTD] = SUM ([AUD DLY] from 1 March 2016 to 3 March 2016)
  </code></pre>
  
  <p>I created a New Calculated Member from Calculations tab in the Cube designer in the BIDS 2010. The MDX query is below. However when I try to browse the cube the [AUD MTD] values are only returning nulls. </p>
  
  <p>Can someone please help what am I doing wrong ?</p>
  
  <pre><code>CREATE MEMBER CURRENTCUBE.[Measures].[AUD MTD]
  AS Aggregate
  (
      PeriodsToDate
          (
          [Date].[Financial].[Month]
          ,[Date].[Financial].CurrentMember
          )
          ,[Measures].[AUD DLY]
  ), 
  FORMAT_STRING = "Currency", 
  NON_EMPTY_BEHAVIOR = { [AUD DLY] }, 
  VISIBLE = 1 ,  DISPLAY_FOLDER = 'AUD Values' ,  ASSOCIATED_MEASURE_GROUP = 'Measures'  ; 
  </code></pre>
  
  <p>Also the business would be using the new calculated measure in excel using the Slicer, they want to select any date and be able to view the MTD value for that month.</p>
  
  <p>Also can someone please help with MDX query for both methods (1) and (2) ?</p>
  
  <p>Your help much appreciated.</p>