LASTNMONTH

Filters a range of data from the last 'n' months prior to the current month.

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

Syntax

LASTNMONTH(number_of_months)

Arguments

number_of_months – The number of preceding months for which data has to be fetched. Required.

Return value

Period Range.

Example

LASTNMONTH(15) 
//Returns data for the past 15 months preceding the start of the current month
LASTNMONTH

Last updated

Was this helpful?