Daily DAX : Day 459 OPENINGBALANCEWEEK
OPENINGBALANCEWEEK – DAX Function
Purpose: Returns the value of an expression calculated at the end of the previous week (i.e. the opening balance position carried into the current week).
Syntax (2025+ calendar-based version)
OPENINGBALANCEWEEK(
<expression>,
<calendar>
[,<filter>]
)
Parameters
- expression → usually a measure like
SUM(Sales[Amount])orSUMX(Inventory, [Value]) - calendar → reference to your calendar table (must have date column marked as Date table)
- filter (optional) → additional filter context (rarely used)
What it really returns
The value your measure had on the last day of the previous week.
→ Monday's opening balance = Sunday's closing balance (of the prior week)
→ Monday's opening balance = Sunday's closing balance (of the prior week)
Typical Use Cases
- Opening inventory / stock value at the start of each week
- Opening cash / bank balance before weekly transactions
- Carried-forward arrears / backlog at week start
- Week-to-date change calculation:
Weekly Increase = [Current Balance] - [Opening Balance Week] - Comparing week-start position vs. week-end position in finance & operations
Practical Example – Opening Inventory Value
Opening Inventory Value =
OPENINGBALANCEWEEK(
SUMX( ProductInventory, ProductInventory[UnitCost] * ProductInventory[UnitsBalance] ),
'Calendar'[Date]
)
This measure shows the inventory value that was already in the warehouse when the current week began.
Quick Comparison – Related Week Functions (2025+)
| Function | Returns value from... |
|---|---|
| OPENINGBALANCEWEEK | End of previous week (week start position) |
| CLOSINGBALANCEWEEK | End of current week |
| TOTALWTD | Week-to-date total (from week start to current date) |
Note: Requires a proper Date table and calendar-based time intelligence (available since late 2025 in Power BI).
Older style without calendar parameter is mostly replaced.
Comments
Post a Comment