Calculated Member for the TOTAL of a measure for multiple Dimensions

邮差的信 提交于 2019-12-11 03:51:53

问题


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:


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:



来源:https://stackoverflow.com/questions/53104535/calculated-member-for-the-total-of-a-measure-for-multiple-dimensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!