OPENINGBALANCEMONTH Function (DAX)

How does the OPENINGBALANCEMONTH function (DAX) work?

The OPENINGBALANCEMONTH function (DAX) evaluates the expression at the first date of the month in the current context.

OPENINGBALANCEMONTH Formula Syntax

OPENINGBALANCEMONTH(
     <expression>,<dates>[,<filter>]
)

How do you use the OPENINGBALANCEMONTH function?

The dates parameter can be any of the following −

  • A reference to a date/time column.
  • A table expression that returns a single column of date/time values.
  • A Boolean expression that defines a single-column table of date/time values.

Constraints on Boolean expressions −

  • The expression cannot reference a calculated field.
  • The expression cannot use CALCULATE function.
  • The expression cannot use any function that scans a table or returns a table, including aggregation functions.

However, a Boolean expression can use any function that looks up a single value, or that calculates a scalar value.

The filter parameter can be a Boolean expression or a table expression that defines a filter.

Related Blog Posts

Related Support Forum Posts

Information – OPENINGBALANCEMONTH, STARTOFMONTH, ENDOFYEAR
Understanding DAX Formula
Developing Complex Dax functions

Considerations when using the OPENINGBALANCEMONTH function

If the data is filtered, the function changes the context in which the data is filtered, and the expression is evaluated in the new context you define. All current filters on that column are removed for each column used in a filter parameter and instead the filter used in the filter parameter is applied.

Related Video Tutorials

Formula examples using the OPENINGBALANCEMONTH function

The following sample formula creates a measure that calculates the ‘Month Start Inventory Value’ of the product inventory.

= OPENINGBALANCEMONTH (
   SUMX(
     ProductInventory,ProductInventory
        UnitCost]*ProductInventory[UnitsBalance]),
         DateTime[DateKey]
)

Related DAX Functions

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership