title: How to correctly replace value of ( [Some Dimension].[All], [Some Measure] )? (MDX, SCOPE())
body: <p>I'm using SQL Server Analysis Servises 2008 R2.</p>
  
  <p>I need<sup>1</sup> to replace the value of <code>[Some Dimension].[All]</code> when calculated against <code>[Some Measure]</code>. Here's what I have tried:</p>
  
  <pre><code>SCOPE( [Some Dimension].[All] );
    [Measures].[Some Measure] = 123; // for simplicity sake
  END SCOPE;
  </code></pre>
  
  <p>This works as expected when I query against <code>[Some Dimension]</code> – the <code>[All]</code> member returns <code>123</code>, and other members are untouched, showing the actual associated <code>[Some Measure]</code> values.</p>
  
  <p>But for some strange reason, all of the members in all other dimensions now return <code>123</code> for <code>[Some Measure]</code>. I am really lost. Please advice me how to fix this, and why this is happening.</p>
  
  <p><sup>1</sup> <sub><em>For the ones who are curious:</em> the reason I want to replace the value of <code>[All]</code> is because <code>[Some Dimension]</code> and <code>[Some Measure]</code> are related as many-to-many. Because of this, tuple <code>( [Some Dimension].[All], [Some Measure] )</code> always returns the total count for <code>[Some Measure]</code> in the cube. What I <em>want</em> it to return is the count of <code>[Some Measure]</code> that are actually associated with at least one member of <code>[Some Dimension]</code></sub>.</p>