Calculated Member for the TOTAL of a measure for m

2019-07-15 00:48发布

I am trying to TOTAL a measure with a calculated measure AS

CALCULATE;     
CREATE MEMBER CURRENTCUBE.[Measures].[Total On Hand Amount]
AS ([Warehouses].[Warehouses].[All],[Measures].[On Hand Amount]), 
FORMAT_STRING = "#,#", 
VISIBLE = 1;

This is working when I have warehouse Dimension selected but I want to make it dynamic so that it would work for any other dimensions/hierarchies as well without them being added to the code.

Any help is appreciated!!

1条回答
迷人小祖宗
2楼-- · 2019-07-15 01:28

I think you want to use Root

CALCULATE;     
CREATE MEMBER CURRENTCUBE.[Measures].[Total On Hand Amount]
AS AGGREGATE(Root(),[Measures].[On Hand Amount]), 
FORMAT_STRING = "#,#", 
VISIBLE = 1;

Here is a small example with: Total Sales Amount

ROOT to get the value on the ALL level/default member for all dimensions

查看更多
登录 后发表回答