Chicago1988
Chicago1988

Reputation: 684

Applying measure for months -12 to -24 doesnt work

I have 2 measures, where depending on the date filters selected, I show:

Last 12 months:

CALCULATE
(
[Xyz] , DATESINPERIOD (  'Date'[Date] ,  MAX('Date'[Date]) ,  -12 ,  MONTH  )
)

I need to do the same, but for months -12 to -24.

I have tried, but DATEADD doesn’t seem to work with MAX…

var dat = MAX('Date'[Date])

RETURN
CALCULATE
(
    [Xyz] , 
    DATESINPERIOD(
            'Date'[Date],    
            DATEADD(dat,-12,MONTH)    ,-24,MONTH)

) 

How can I make the period from -12 to -24 ?

Upvotes: 0

Views: 70

Answers (1)

Ozan Sen
Ozan Sen

Reputation: 2615

What if you try this ????? Even If I haven't tested it yet. I know you can nest Time Intelligence Functions.

_12_24 Period =
CALCULATE (
    [Xyz],
    SAMEPERIODLASTYEAR (
        DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -12, MONTH )
    )
)

Upvotes: 1

Related Questions