Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Note
This function is discouraged for use in visual calculations as it likely returns meaningless results.
Returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates
column, in the current context.
SAMEPERIODLASTYEAR(<dates>)
Term | Definition |
---|---|
dates |
A column containing dates. |
A single-column table of date values.
The dates
argument can be any of the following:
Constraints on Boolean expressions are described in the topic, CALCULATE.
The dates returned are the same as the dates returned by this equivalent formula: DATEADD(dates, -1, year)
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
The following sample formula creates a measure that calculates the previous year sales of Reseller sales.
= CALCULATE(SUM(ResellerSales_USD[SalesAmount_USD]), SAMEPERIODLASTYEAR(DateTime[DateKey]))
Time intelligence functions Date and time functions PREVIOUSYEAR PARALLELPERIOD
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today