I am trying to write a simple CASE statement in MDX that returns Measure values from different Fact tables based on a particular dimension type as below –
WITH MEMBER [Measures].[Amount] AS
CASE [Dim Trx Type].[Trx Type Id].CURRENTMEMBER
WHEN [Dim Trx Type].[Trx Type Id].&[1] THEN [Measures].[Amount - Fact Sale]
WHEN [Dim Trx Type].[Trx Type Id].&[2] THEN [Measures].[Amount - Fact Sale]
WHEN [Dim Trx Type].[Trx Type Id].&[11] THEN [Measures].[Amount - Fact Usage]
END
I am then using the [Measures].[Amount] in my MDX. Problem here is I am not getting the required value for Type 11. If I move my the when case to first line, I am getting the value for usage and sometimes for Sale. A wierd behavior I am not able to understand.
Can somebody help?
Try with CELL CALCULATION: