title: How to create a calculated member based on two measures and the hierarchy level of the queried dimension's current member?
body: <p>I have a cube which has</p>
  
  <ul>
  <li>two measure members: <code>[Measures].[Value]</code> (integer) and <code>[Measures].[EffectiveBelowLevel]</code> (integer).</li>
  <li>a dimension called [DimParentChild] with a ragged user hierarchy called <code>[ParentChildHierarchy]</code>.</li>
  </ul>
  
  <p>I would like to create a calculated member on the measures dimension <code>([Measures].[EffectiveValue])</code> based on <code>[Measures].[Value]</code> which when queried along <code>[DimParentChild]</code> and <code>[ParentChildHierarchy]</code> behaves as follows:</p>
  
  <pre><code>- [Measures].[Value] is used if the hierarchy level of [DimParentChild].[ParentChildHierarchy].CURRENTMEMBER &gt; [Measures].[EffectiveBelowLevel].
   - 0 is used if the hierarchy level of [DimParentChild].[ParentChildHierarchy].CURRENTMEMBER &lt;= [Measures].[EffectiveBelowLevel].
  </code></pre>
  
  <p>Is it possible to achieve this functionaly with a calcuated member on the measures dimension?</p>
  
  <p>If yes then what the formula would look like?</p>
  
  <p>If not then what other way would there be? 
  I am very interested in any other kind of solution as well (e.g. an mdx query, etc.)</p>
  
  <p>As an example:</p>
  
  <pre>
  <b>[Measures]</b>
  <b>[Value] [EffectiveBelowLevel] ParentChildAssociation</b>
  10      1                     GrandChild1
  20      2                     GrandChild2
  </pre>
  
  <pre>
  <b>[DimParentChild].[ParentChildHierarchy]</b>
  <b>Member      HierarchyLevel   Description</b>
  Parent        1             - 
  Child         2             first child of Parent 
  GrandChild1   3             first child of Child
  GrandChild2   3             second child of Child
  </pre>
  
  <p>With this data [Measures].[EffectiveValue] should look like this</p>
  
  <pre>
  <b>ParentChild   EffectiveValue</b>
  Parent            0
  Child            10
  GrandChild1      10
  GrandChild2      20
  </pre>