OpenBI Docs Buy

FIRSTDATE

The first date in the filter context, as a table of one row.

Group: Time intelligence. Compatible with DAX.

Syntax

FIRSTDATE ( <dates> )
ParameterTypeDescription
datesDatesA column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model.

Returns

Table. The first 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, as in ROW or a comparison; when the context holds no date, the value is blank.
  • On a column of the facts, it is the first date that has rows; on a date table, the first date of the table's filter, whether or not anything happened on it.
  • It differs from MIN in what it returns, a table that can filter, and in the context transition it makes in a row context.
  • 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

First and last month of each scenario

The ledger's own Month column follows the scenario; Periods, the date table, does not.

EVALUATE
SUMMARIZECOLUMNS (
    Ledger[Scenario],
    "First month", FIRSTDATE ( Ledger[Month] ),
    "Last month", LASTDATE ( Ledger[Month] ),
    "Last of Periods", LASTDATE ( Periods[Month] )
)
ORDER BY Ledger[Scenario]
Ledger[Scenario]First monthLast monthLast of Periods
Actual2024-01-012026-09-012026-12-01
Budget2024-01-012026-12-012026-12-01
Forecast2026-01-012026-12-012026-12-01

LASTDATE, STARTOFMONTH, FIRSTNONBLANK, MIN.

Last updated · OpenBI Studio 0.3.74