SAMEPERIODLASTYEAR DAX Function

The SAMEPERIODLASTYEAR DAX function returns a single-column table with single value of date shifted one year back in time from the dates in the specified dates column, in the current context.

The dates returned are the same as the dates returned by this equivalent formula: DATEADD(dates, -1, YEAR)

DAX Syntax SAMEPERIODLASTYEAR(date)

The parameter “dates” is a column containing dates.

Example: Let’s create a measure with name “Sum of Sameperiodlastyear income”.

DAX

Sum of Sameperiodlastyear income =
CALCULATE (
    SUM ( Sheet8[Annual Income] ),
    SAMEPERIODLASTYEAR ( 'Sheet8'[Year] )
)  

The output of the above dax code is shown below:

SAMEPERIODLASTYEAR dax function