Daily DAX : Day 404 CLOSINGBALANCEQUARTER
Power BI DAX Function: CLOSINGBALANCEQUARTER
Returns the value of an expression evaluated at the last date of the current quarter in the current context.
Syntax
CLOSINGBALANCEQUARTER(<Expression>, <Dates>[, <Filter>])
| Parameter | Description |
|---|---|
| <Expression> | The measure or calculation you want to evaluate (e.g., SUM(Sales[Amount])) |
| <Dates> | A column containing dates (usually from your Date table, e.g., 'Date'[Date]) |
| <Filter> | (Optional) A filter to apply to the dates |
How It Works
No matter which day, month, or year is currently visible in your visual or filter context, CLOSINGBALANCEQUARTER always returns the value as of June 30, September 30, December 31, or March 31 of the quarter that contains the current context.
- It looks forward to the end of the current quarter.
- It is time-intelligence function — perfect for quarter-end balances, inventory, headcount, account balances, etc.
Common Use Cases
| Use Case | Example Measure |
|---|---|
| Quarter-End Sales | Quarter End Sales = CLOSINGBALANCEQUARTER(SUM(Sales[Amount]), 'Date'[Date]) |
| Quarter-End Inventory Value | QE Inventory = CLOSINGBALANCEQUARTER(SUM(Inventory[Quantity] * Inventory[UnitCost]), 'Date'[Date]) |
| Quarter-End Headcount | QE Employees = CLOSINGBALANCEQUARTER(COUNTROWS(Employees), 'Date'[Date]) |
| Quarter-End Account Balance | QE Balance = CLOSINGBALANCEQUARTER(SUM(Transactions[Amount]), 'Date'[Date]) |
Example Scenario
Imagine today is May 15, 2025 (Q2 FY2025).
If your report shows monthly data and the current row context is May 2025, CLOSINGBALANCEQUARTER will return the value as of June 30, 2025 — even though June hasn't happened yet (useful for forecasting or showing the projected quarter-end value).
Related Functions
CLOSINGBALANCEMONTH→ last day of current monthCLOSINGBALANCEYEAR→ last day of current year (Dec 31)OPENINGBALANCEQUARTER→ first day of current quarter
Tip: Always use a proper Date table marked as a date table in Power BI for time-intelligence functions to work correctly.
Comments
Post a Comment