MDX ignoring Excel filter

牧云@^-^@ 提交于 2019-12-04 15:33:58

With Visual Studio SQL Server Data Tools (if you are using that tool), you can browse to your cube, select the Calculations tab, and under Calculations Tools > Templates there is a template "Percentage of Total". The MDX this tool provides is flexible so that the percentage adjusts with the attributes of the hierarchy you've pulled into the pivot.

Case
// Test to avoid division by zero.
When IsEmpty
 ( 
    [Measures].[<<Target Measure>>] 
 ) 
Then Null

Else ( [<<Target Dimension>>].[<<Target Hierarchy>>].CurrentMember,
   [Measures].[<<Target Measure>>] ) 
 /
 ( 
   // The Root function returns the (All) value for the target dimension.
   Root     
   ( 
      [<<Target Dimension>>] 
    ), 
    [Measures].[<<Target Measure>>] 
 )
End

I found this option to work when developing to achieve what you've mentioned.

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