OpenBI Docs Buy

STARTOFYEAR

The first date of the year in the filter context (the year ending on 31 December, or on a date given).

Group: Time intelligence. Compatible with DAX.

Syntax

STARTOFYEAR ( <dates> [, <year_end_date>] )
ParameterTypeDescription
datesDatesA column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model.
year_end_dateText
optional
The year's last day as month and day, such as "6-30" for a year that ends on 30 June; when left out, 31 December. Not used with a calendar, whose own years count.

Returns

Table. The year's first date that the column holds, as a table of one row.

Remarks

  • The year is the one of the first date in the filter context; with a year end, it starts the day after the year end before.
  • The table of one row can be used as a value; with no date in the context, it is blank.
  • Given a column, it reads the dates visible in the current filter context; in a row context, such as ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates.
  • 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

Calendar year and a season to June

July starts a new season.

EVALUATE
SUMMARIZECOLUMNS (
    Prices[Month],
    FILTER ( VALUES ( Prices[Month] ), Prices[Month] >= DATE ( 2025, 5, 1 ) && Prices[Month] <= DATE ( 2025, 8, 1 ) ),
    "Start of year", STARTOFYEAR ( Prices[Date] ),
    "Start of season", STARTOFYEAR ( Prices[Date], "6-30" ),
    "End of season", ENDOFYEAR ( Prices[Date], "6-30" )
)
ORDER BY Prices[Month]
Prices[Month]Start of yearStart of seasonEnd of season
2025-05-012025-01-012024-07-012025-06-30
2025-06-012025-01-012024-07-012025-06-30
2025-07-012025-01-012025-07-012026-06-30
2025-08-012025-01-012025-07-012026-06-30

ENDOFYEAR, STARTOFQUARTER, DATESYTD, OPENINGBALANCEYEAR.

Last updated · OpenBI Studio 0.3.74