LASTNYEAR

Filters a range of data from the last 'n' years prior to the current year.

The LASTNYEAR function can be used to select data from a given measure for a specified number of years preceding the start of the current year. It should be used in conjunction with the SELECT clause and with an aggregate function like SUM or AVERAGE.

Syntax

LASTNYEAR(number_of_years)

Arguments

number_of_years – The number of preceding years for which data has to be fetched. Required.

Return value

Period Range.

Example

LASTNYEAR(2) 
//Returns data for 2 years preceding the start of the current year
LASTNYEAR

Last updated

Was this helpful?