title: MDX Count with a Filter?
body: <p>We want to count the weeks where "Inventory Units" were greater then 0.<br>
  I have put this together but it doesn't quite work, it counts all weeks for an item not just the ones where Inventory > 0. I have tried some filters but they always result in #error as the result</p>
  
  <pre><code>WITH 
    SET [PreviousSixWeeks] AS 
      Tail
      (
        Filter
        (
          [Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Week]
         ,
          [Measures].[Inventory Units] &gt; 0
        )
       ,6
      ) 
    MEMBER [Measures].[INVWeekCount] AS 
      DistinctCount(PreviousSixWeeks*[Measures].[Inventory Units]*[Item].[Item Code]) 
  SELECT 
    {[Measures].[INVWeekCount]} ON COLUMNS
   ,{[Item].[Item Code].[Item Code]} ON ROWS
  FROM 
  (
    SELECT 
      {[Location].[Location].&amp;[64]} ON COLUMNS
    FROM 
    (
      SELECT 
        {
          [Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[2].&amp;[8]
         ,[Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[2].&amp;[9]
         ,[Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[3].&amp;[10]
         ,[Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[3].&amp;[11]
         ,[Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[3].&amp;[12]
         ,[Time].[Yr-Qtr-Per-Wk-Day].[Fiscal Year].&amp;[2016].&amp;[1].&amp;[3].&amp;[13]
        } ON COLUMNS
      FROM [RFP]
    )
  );
  </code></pre>