Hi,

I´m a newbie in MDX.
I want to create a calculated member which shows the percentage allocation of a measure. I use the following code:

CREATE MEMBER [myCube].[Measures].ZM1 AS
'(Dim1.CurrentMember, [Measures].ZM1perc) / (Dim1.CurrentMember.parent, [Measures].ZM1perc)'

With only one dimension everything is OK. But with more than one dimension, the value of "(RD1.CurrentMember.parent, [Measures].ZM1perc)" is wrong starting with the second dimension.

My goal is to display the results in one of two different ways (or better, both of them, making the behaviour configurable):

1.
In this case the percentage values for the members in the 2nd dimension refer to the total data set:

Dim1- Value
M1 - - 30%
M2 - - 60%
M3 - - 10%
--------------------------- expand M1
Dim1 Dim2 - Value
M1 - - B1 - - 10%
M1 - - B2 - - 15%
M1 - - B3 - - 05%
M2 - - B4 - - 30%
... ... ...

2.
In this case the percentage values for the members in the 2nd dimension would refer to the data set represented by the parent member, interpreting the parent member value as 100%. An example would be:

Dim1 Value
M1 - - 30%
M2 - - 60%
M3 - - 10%
--------------------------- expand M1
Dim1 Dim2 - Value
M1 - - B1 - - 23%
M1 - - B2 - - 60%
M1 - - B3 - - 12%
M2 - - B4 - - 30%
... ... ...

Any ideas how I can do this?

Regards,
Thorsten Blawatt