Search code examples
ssasmdxolapcubemdx-query

Calculated member in SSAS cube based on two dimensions


I would like to create a calculated member within my Calculations inside a SSAS cube, but it has to be based on two separate dimensions (I don't know how to call it in a different, maybe "better" way..). Below there is a picture what I mean:

New calculated member

I need member "FYE" based on values from two dimensions - "Time Calculations" and "Analysis". From "Time Calculations" I have to sum up "YTD" (but only "Actual" from dimension "Analysis") with "ROY" (but only "Budget" from dimension "Analysis"). Is it even possible? If so then how? Thank you for any help in that case :)


Solution

  • You have to define measures that return 100 and 600 from your example. Once you have done that, create a calc measure equal to ([DimTimeCalculations].[Time Calculations].[YTD], [DimAnalysis].[Analysis].&[Actual], [Measures].[<measure to produce 100>]) + ([DimTimeCalculations].[Time Calculations].[ROY], [DimAnalysis].[Analysis].&[Budget],[Measures].[,<measure to produce 600>]).

    One caveat - this CM will produce identical results for all members of [DimTimeCalculations].[Time Calculations] and [DimAnalysis].[Analysis] hierarchies. To fix that you need to create scope assignments for individual members.