Here is my structure:
DimFiscalYear
Year
Quarter
[Year Quarter] (hierarchy of Year-Quarter)
Measure
Sales amount
CREATE MEMBER CURRENTCUBE.[Measures].[Amount YOY quarter]
AS SUM({[DimFiscalYear].[Year Quarter].Lag(4):[DimFiscalYear].[Year Quarter].Lag(4)},[Measures].[Sales amount]),
VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Measure Sales';
Result
Current YOY
2020 Q1 250000 0
2020 Q2 175000 0
2020 Q3 345000 0
2020 Q4 275000 0
2021 Q1 430000 250000
2021 Q2 145000 175000
Instead of using Lag, I would rather want to use COUSIN, but I'm not able to have a syntax that works.
Thanks