SSAS / MDX Query – Need row total

mdxssas

I would like to add an additional row that will display the Total order count for all the different Customers in the Customer Dimension. Below is the query that I have been trying to modify.

SELECT NON EMPTY { [Measures].[Order Count] } ON COLUMNS
    ,NON EMPTY {([Date].[Year].[Year].ALLMEMBERS 
       * [Date].[Quarter].[Quarter].ALLMEMBERS 
       * [Order].[Customer].[Customer].ALLMEMBERS) } DIMENSION PROPERTIES MEMBER_CAPTION
    ,MEMBER_UNIQUE_NAME ON ROWS FROM [Order] CELL PROPERTIES VALUE

Currently it is displaying as :

                                               | Order Count
Calendar 2012   |Quarter 1, 2012    |D         |31

What i need is below:

                                               | Order Count
Calendar 2012   |Quarter 1, 2012    |D         |31

Total                                          |122011

Best Answer

Try adding the All member into the set on rows:

SELECT 
  NON EMPTY 
    {[Measures].[Order Count]} ON 0
 ,NON EMPTY 
    {
        [Date].[Year].[Year].ALLMEMBERS*
        [Date].[Quarter].[Quarter].ALLMEMBERS*
        {
          [Order].[Customer].[Customer].ALLMEMBERS
         ,[Order].[Customer].[All]
        }
    }
  DIMENSION PROPERTIES 
    MEMBER_CAPTION
   ,MEMBER_UNIQUE_NAME
   ON 1
FROM [Order]
CELL PROPERTIES VALUE