LASTNMONTH
The LASTNMONTH function can be used to select data from a given measure, for a specified number of months preceding the current month. It should be used in conjunction with the SELECT clause and with an aggregate function like SUM or AVERAGE.
Syntax
Arguments
number_of_months – The number of preceding months for which data has to be fetched. Required.
Return value
Range of data.
Example
![](https://docs.inforiver.com/~gitbook/image?url=https%3A%2F%2F3062809325-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEbkCXCUXmtUq5tcnUtZE%252Fuploads%252Fyc9OZzUZEklz9e5SejFB%252Fimage.png%3Falt%3Dmedia%26token%3D19621f77-b1ce-40ef-9d5d-df84b8803503&width=768&dpr=4&quality=100&sign=6c599cca&sv=1)
Last updated