LASTDATE
The last date in the filter context, as a table of one row.
Group: Time intelligence. Compatible with DAX.
Syntax
LASTDATE ( <dates> )
| Parameter | Type | Description |
|---|---|---|
dates | Dates | A column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model. |
Returns
Table. The last date in the filter context, as a table of one row; empty when there is none.
Remarks
- The table of one row can be used as a value; when the context holds no date, the value is blank.
- On a date table it is the last date of the table's filter, not the last date with data: Periods runs to December 2026 even where the actuals stop in September. For the last date with data use
LASTNONBLANK. - Used as a filter in
CALCULATE, it gives a value on the last date only. - Given a calendar instead of a column, it works on the calendar's own periods (fiscal years, retail months of four or five weeks, ISO weeks). A filter on a category the calendar does not define, such as a month on a calendar of weeks, can make the call an error.
Examples
The last month of the data
EVALUATE
ROW ( "First month", FIRSTDATE ( Sales[Month] ), "Last month", LASTDATE ( Sales[Month] ) )
| First month | Last month |
|---|---|
| 2023-11-01 | 2026-10-01 |
Last month of each scenario
EVALUATE
SUMMARIZECOLUMNS (
Ledger[Scenario],
"Last month", LASTDATE ( Ledger[Month] ),
"Last of Periods", LASTDATE ( Periods[Month] ),
"Last with an amount", LASTNONBLANK ( Periods[Month], [Booked amount] )
)
ORDER BY Ledger[Scenario]
| Ledger[Scenario] | Last month | Last of Periods | Last with an amount |
|---|---|---|---|
| Actual | 2026-09-01 | 2026-12-01 | 2026-09-01 |
| Budget | 2026-12-01 | 2026-12-01 | 2026-12-01 |
| Forecast | 2026-12-01 | 2026-12-01 | 2026-12-01 |