title: Cube Calculation median age (MDX)
body: <p>I need to create cube calculation for median Age in a HR cube.</p>
  
  <p>Measures: head count and FTE </p>
  
  <p>Dimension:  Age (Age, Age_Group, ...), Duty_type, Staff (Staff_ID, ...), Date, etc</p>
  
  <p>I tried to use the following MDX script: </p>
  
  <pre><code>Median([Month Date].[Staff Profile Month Date - Hierarchy].[Month Date Calendar Year].currentmember.Children ,IIF([Age].[Age].currentmember.name ='All' ,0,StrToValue([Age].[Age].currentmember.name)))
  </code></pre>
  
  <p>I used the following help: <a href="http://msdn.microsoft.com/en-us/library/ms145570.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms145570.aspx</a> </p>
  
  <p>How can this be solved?</p>