根据选定的维度成员汇总事实

Aggregate Facts bases on selected Dimension members

如何添加如下图所示的总计列。

查询结构如下

WITH
    MEMBER [Measure].[Total Responses] AS [Measures].[Responses]

    MEMBER [Measure].[Option 1] as CoalesceEmpty([Measures].[Option1],0)
    MEMBER [Measure].[Option 2] as CoalesceEmpty([Measures].[Option2],0)
SELECT
{
    //Add Total Here for Below Dimension Members
    [Date].[Month].&[2018]&[2018-Q4]&[2018-09], //say Month 1
    [Date].[Month].&[2018]&[2018-Q4]&[2018-10], //say Month 2
    [Date].[Month].&[2019]&[2019-Q1]&[2019-01]  //say Month 5 
} ON COLUMNS,
NON EMPTY
{
    [Measure].[Total Responses],
    [Measure].[Option 1],
    [Measure].[Option 2]
} ON ROWS
FROM [Cube]

在下面的查询中,编辑被标记为 **

WITH
  MEMBER [Measure].[Total Responses] AS [Measures].[Responses]

  **MEMBER [Date].[Month].[AllMessages] AS AGGREGATE({[Date].[Month].&[2018]&[2018-Q4]&[2018-12],[Date].[Month].&[2019]&[2019-Q1]&[2019-01]})

  MEMBER [Measure].[Option 1] as CoalesceEmpty([Measures].[Option1],0)
  MEMBER [Measure].[Option 2] as CoalesceEmpty([Measures].[Option2],0)

SELECT
{
  **[Date].[Month].[AllMessages],
  [Date].[Month].&[2018]&[2018-Q4]&[2018-12],
  [Date].[Month].&[2019]&[2019-Q1]&[2019-01]
} ON COLUMNS,
NON EMPTY
{
  [Measure].[Total Responses],
  [Measure].[Option 1],
  [Measure].[Option 2]
} ON ROWS
FROM
  [Cube]