title: MDX Calculation speed - CurrentMember?
body: <p>I am still getting to grips with MDX and I am looking for some help. Here is my MDX query:</p>
  
  <pre><code> CREATE MEMBER CURRENTCUBE.[Measures].[Fake]
     AS 
     IIF(
      (
        (
          [Sales Data].[Ship-to No].CurrentMember
         ,[Sales Data].[Price Type].&amp;[Core]
         ,[Measures].[Sales - Local Currency]
        ) 
      / (
          [Sales Data].[Ship-to No].CurrentMember,
          [Sales Data].[Price Type].[(All)].[ALL],
          [Measures].[Sales - Local Currency]
        )
      ) &gt; 0.9 
    ,1 
    ,NULL
    ), 
  VISIBLE = 1; 
  
  CREATE MEMBER CURRENTCUBE.[Measures].[Test Calc]
    AS 
    SUM(
       Descendants(
         [Sales Data].[Ship-to No].CurrentMember
        ,[Sales Data].[Ship-to No].[Ship-to No]
       ),
      [Measures].[Fake]
    ), 
  VISIBLE = 1; 
  </code></pre>
  
  <p>SalesData is the fact table and the basic calculation is to count the number of customers that have sales of more than 90% of the price type "Core".</p>
  
  <p>The query currently takes around 5 seconds to complete but I think this can be faster if I don't use CurrentMember according to <a href="http://sqlblog.com/blogs/mosha/archive/2008/07/29/product-volatility-optimizing-mdx-with-mdx-studio.aspx" rel="nofollow noreferrer">http://sqlblog.com/blogs/mosha/archive/2008/07/29/product-volatility-optimizing-mdx-with-mdx-studio.aspx</a></p>
  
  <p>But I don't know where to begin in changing this, can anyone help me make this more efficient?</p>