-1

enter image description here

Here we have total 14 rows, I need one more column (RowCount-Column name) every-cell contains 14 (reputation) means total row counts.

below is the query

WITH MEMBER DimName  AS [DimClinic].[Provider Key].CurrentMember.Member_Caption
     MEMBER DimKey   AS [DimClinic].[Provider Key].CurrentMember.Member_Key 

SELECT {[Measures].DimKey  ,
        [Measures].DimName ,
        [Measures].[DrPatientKeyCnt]} ON COLUMNS ,
NonEmpty([DimClinic].[Provider Key].[Provider Key])ON ROWS 
FROM [PopulationReportCube] 
Yugandhar
  • 97
  • 9

1 Answers1

0
WITH 
  MEMBER DimName AS 
    [DimClinic].[Provider Key].CurrentMember.Member_Caption 
  MEMBER DimKey AS 
    [DimClinic].[Provider Key].CurrentMember.Member_Key 
  MEMBER RowCount AS 
    Count
    (
      NonEmpty
      (
        [DimClinic].[Provider Key].[Provider Key]
       ,[Measures].[DrPatientKeyCnt]
      )
    ) 
SELECT 
  {
    [Measures].DimKey
   ,[Measures].DimName
   ,[Measures].[DrPatientKeyCnt]
   ,[Measures].[RowCount]
  } ON COLUMNS
 ,NonEmpty([DimClinic].[Provider Key].[Provider Key]) ON ROWS
FROM [PopulationReportCube];
whytheq
  • 34,466
  • 65
  • 172
  • 267
Yugandhar
  • 97
  • 9
  • 1
    cool - that was an easy one for me!! ...although now it is a little prettier. You should download MDXStudio if you're enjoying playing with mdx - it is better than SSMS – whytheq Mar 29 '16 at 11:18