OpenBI Docs Buy

OPENINGBALANCEYEAR

An expression evaluated at the last date of the year before the filter context's (the year ending on 31 December, or on a date given).

Group: Time intelligence. Compatible with DAX.

Syntax

OPENINGBALANCEYEAR ( <expression>, <dates> [, <filter>] [, <year_end_date>] )
ParameterTypeDescription
expressionExpressionThe value wanted on that one date, usually a measure of a level such as a price, a stock or a balance.
datesDatesA column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model.
filterFilter
optional
A condition or a table that filters as well, as a filter argument of CALCULATE does.
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

Same type as the expression. The expression on the last date the column holds before the year.

Remarks

  • The year is the one of the first date in the filter context, ending on 31 December or on the year end given; the opening is the closing of the year before.
  • With three arguments, a text in the third place is read as the year end, not as a filter.
  • A filter on another column of the dates' table (a year column) stays and can leave that date out: the result is then blank.
  • When the expression is blank on that date, the result is BLANK.
  • 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

Opening of the calendar year and of a season

From the third quarter of 2025: the close on 31 December 2024, and on 30 June 2025 for a year that ends in June.

EVALUATE
CALCULATETABLE (
    ROW (
        "Year", OPENINGBALANCEYEAR ( [Close price], Prices[Date] ),
        "Season", OPENINGBALANCEYEAR ( [Close price], Prices[Date], "6-30" )
    ),
    Prices[Commodity] = "Malting barley",
    DATESBETWEEN ( Prices[Date], DATE ( 2025, 7, 1 ), DATE ( 2025, 9, 30 ) )
)
YearSeason
3909.424224.44

CLOSINGBALANCEYEAR, OPENINGBALANCEQUARTER, PREVIOUSYEAR, STARTOFYEAR.

Last updated · OpenBI Studio 0.3.74