Forum Discussion

Talal141218's avatar
Talal141218
Icon for Helper III rankHelper III
3 years ago
Solved

YTD Last year

 Hi everyone, 

I want to create a measure to select throgh it YTD for last year and i tryed but as below : 

=calculate( YTD, sameperiodlastyear(date))., but i did't got a result. 

 

Could you please support me to create a correct m,easure. 

Thanks in advace 

  • Hi Talal141218 

    please try

    YTD LY =
    CALCULATE (
    [Measure],
    FILTER (
    SAMEPERIODLASTYEAR ( 'Date'[Date] ),
    VALUE ( FORMAT ( [Date], "mmdd" ) ) <= VALUE ( FORMAT ( TODAY (), "mmdd" ) )
    )
    )

1 Reply

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Talal141218 

    please try

    YTD LY =
    CALCULATE (
    [Measure],
    FILTER (
    SAMEPERIODLASTYEAR ( 'Date'[Date] ),
    VALUE ( FORMAT ( [Date], "mmdd" ) ) <= VALUE ( FORMAT ( TODAY (), "mmdd" ) )
    )
    )