MDX: How to get rows count
<p>How to get the row count in new column, please click the above image.
<a href="http://i.stack.imgur.com/9BH8p.png" rel="nofollow">enter image description here</a></p>

<pre><code> WITH MEMBER DimName AS [DimHealthPlan].[Health Plan Key].CurrentMember.Member_Caption 
      MEMBER DimKey AS [DimHealthPlan].[Health Plan Key].CurrentMember.Member_Key 
      MEMBER [Measures].[Test]  AS ([Measures].[DrPatientKeyCnt] + [Measures].[NrPatientKeyCnt])
      MEMBER RowCount AS COUNT(NONEMPTY([DimHealthPlan].[Health Plan Key].[Health Plan Key]))
SELECT  {[Measures].DimKey ,
         [Measures].DimName,
         [Measures].[HealthPlanPatientCnt],
         [Measures].[CareProviderPatientCnt],
         [Measures].[PCPPatientCnt], 
         [Measures].[Test],
         RowCount} ON COLUMNS ,
NonEmpty([DimHealthPlan].[Health Plan Key].MEMBERS) ON ROWS 
FROM [PopulationReportCube]
</code></pre>