title: MDX Performance Issues on Count & Sum of Filtered Members/Measures
body: <p>I Have the following MDX query I need to run on a cube (which I don't have access to change).</p>
  
  <p>This particular query is taking around 1.5 minutes to run, which is just far too long.  I've been searching for a way to speed it up, but I'm not having a heap of luck.  </p>
  
  <p>Can anyone see a way to improve this query?  I've been tearing my hair out for the last couple of days, so any help would be greatly appreciated!</p>
  
  <pre><code>`WITH
      MEMBER [Measures].[1-99_Count] AS 
          COUNT(FILTER ([Scam].[Scam Ref].AllMembers, 
              ([Measures].[Amount Lost]&gt;=1 AND [Measures].[Amount Lost]&lt;=99)))
      MEMBER [Measures].[1-99_Amount] AS 
          SUM(FILTER ([Scam].[Scam Ref].AllMembers, 
          ([Measures].[Amount Lost]&gt;=1 AND [Measures].[Amount Lost]&lt;=99)),
              Iif(IsEmpty([Measures].[Amount Lost]),0,[Measures].[Amount Lost]))
  SELECT {[Measures].[1-99_Count],
      [Measures].[1-99_Amount]} ON COLUMNS,
      [First Resolved On Date].[Month].[Month] ON ROWS
  FROM [Infocentre]
  WHERE ([First Resolved On Date].[Date].[Date].&amp;[20140101]:[First Resolved On Date].[Date].[Date].&amp;[20150623],
      [Scam].[Scam Category Level1].&amp;[{d9d6bc38-e73e-e411-9a82-0a713f2121f7}])`
  </code></pre>