I have to create the next calculation for 20 different Measures in my OLAP. As you can see the described function calculates the value of a measure the previous year. I have to repeat the code 20 times only changing the specific measure ([Measures].[Sales]
) and I think there is a way of changing the specific measure dynamically.
create MEMBER CURRENTCUBE.[Measures].[Sales ant] as
(ParallelPeriod(
[Dim Calendar].[Calendar].[Year]
,1
,[Dim Calendar].[Calendar].CurrentMember
), [Measures].[Sales]),
VISIBLE = 1 ,ASSOCIATED_MEASURE_GROUP = 'Fact Sales';
Is there is a way in MDX to know which measure in the [Measures]
group is being used? In this case which is the best way to implement it.