In my date dimension I have an attribute called CompareToDatekey which shows the date that should be used to compare measures through time. How can I build a calculated measure that will give the measure value for the compare date when I filter a particular primary date?
What I tried to do is to make a CompareTime dimension which has a referenced relation through the primary time dimension ([time dim].[CompareToDatekey] -> [TimeDim CompareDate].[datekey]) and then use the following calculated member :
WITH MEMBER [Measures].[CompareAmount]
AS
(
Sum(EXISTING [TimeDim CompareDate].[datekey].children
,[Measures].[Net Amount])
)
But the result is the measure filtered by the primary date and not the compare date.
Some test data :
datekey | ComparedToDatekey
20150109 | 20141219
20150110 | 20141220
datekey | NetAmount
20141219 | 1716648.85
20150110 | 2266777.12
20141220 | 2378598.98
20150109 | 1588123.89
I would like a calculated member which give the sum of net amount on 20141219:20141220 when I filter for 20150109:20150110