Forum Discussion

harry6810's avatar
harry6810
Frequent Visitor
3 years ago
Solved

Lastdate -1 filter

Hi there, 

how to calculate measures with LASTDATE -1, -2, -3 etc (or maxstring) filter?

 

My basic code seems to be working:

=CALCULATE(Min('CEN'[Price]);LASTDATE(CEN[Data]))

 

I've tried like this but no effect. 

=CALCULATE(Min('Ceneo'[Price]);LASTDATE(Ceneo[Data]-1))

 

Thanks for any help!

 

  • Day before =
    VAR MaxDate =
        MAX ( Ceneo[Date] )
    RETURN
        CALCULATE ( MIN ( Ceneo[Price] ), Ceneo[Date] = MaxDate - 1 )
    

2 Replies

  • Day before =
    VAR MaxDate =
        MAX ( Ceneo[Date] )
    RETURN
        CALCULATE ( MIN ( Ceneo[Price] ), Ceneo[Date] = MaxDate - 1 )