title: MDX Select Count of Measure where Measure > 0
body: <p>I want to count the number of<br>
  distinct (dimension) USER GUID on a<br>
  particular (dimension) Month
  where (measure) M1 > 0 and (measure) M2 > 0  </p>
  
  <p>My query: </p>
  
  <pre><code> WITH 
    MEMBER [Measures].[M1 Count] AS 
      Count
      (
        NonEmpty
        (
            NonEmpty
            (
              [AAUser].[USER GUID].[USER GUID].MEMBERS
             ,[Measures].[M1]
            )
          * 
            {[Measures].[M1]}
        )
      ) 
    MEMBER [Measures].[T2 Count] AS 
      Count
      (
        NonEmpty
        (
          NonEmpty
          (
            [AAUser].[USER GUID].[USER GUID].MEMBERS
           ,[Measures].[T2]
          )
         ,{[Measures].[T2]}
        )
      ) 
  SELECT 
    {
      [Measures].[M1 Count]
     ,[Measures].[T2 Count]
    } ON COLUMNS
   ,[AATime].[Month].[Month].ALLMEMBERS ON ROWS
  FROM [MyCube]
  WHERE 
    {
        StrToMember("[AATime].&amp;[2013-11-01T00:00:00]")
      : 
        StrToMember("[AATime].&amp;[2014-10-31T00:00:00]")
    };
  </code></pre>
  
  <p>The result I’m getting is:<br>
  <img src="https://i.stack.imgur.com/XUIXO.png" alt="enter image description here"></p>
  
  <p>It’s wrong because I’m selecting <code>NONEMPTY</code>, which would return everything (even if the value is 0). Can anyone please modify my query and filter <code>(where [Measures].[M1] &gt; 0 and [Measures].[M2] &gt; 0)</code></p>