MDX calculated measure by dimension value
<p>I have to filter the measure value by a value in a the article group dimension.</p>

<p>Starting point:</p>

<p><strong>Facts:</strong></p>

<ul>
<li>Inventory (only opening stock of a month)</li>
<li>Sales</li>
</ul>

<p><strong>Dimensions:</strong></p>

<ul>
<li>Articlegroup (content: articlegroup types: Service or not)</li>
<li>Article</li>
<li>Time</li>
</ul>

<p>We have 2 types of sale:</p>

<ul>
<li>Standard sale (affects invetory)</li>
<li>Service (doesn't affects inventory)</li>
</ul>

<p>My MDX-Script calculates dynamically the daily stock over a month.
The problem is that service-sales should not affects the inventory,
so my script have to filter the measure value.</p>

<p>Such like:</p>

<pre><code>CREATE MEMBER CURRENTCUBE.[Measures].[FilteredAmount]
AS (SELECT [Measures].[SalesAmount] FROM [Cube]
    WHERE [Article Group].[Service].&amp;[0])
-- Service "0" = not service

CREATE MEMBER CURRENTCUBE.[Measures].[Amount]
AS [Measures].[OStockAmount] - [Measures].[FilteredAmount]  
</code></pre>

<p>I don't know how to filter the value</p>