<!-- https://learnsql.cpetoday.com/functions/dax/closingbalancequarter -->
# CLOSINGBALANCEQUARTER

Language: DAX
Category: Time intelligence: balances
Syntax: CLOSINGBALANCEQUARTER(<expression>, <dates> [, <filter>])
Summary: Evaluates a balance on the last date of the calendar quarter in the filter context.
Returns: A value (a scalar).
Level: Intermediate
Related: CLOSINGBALANCEMONTH, CLOSINGBALANCEYEAR, OPENINGBALANCEQUARTER, LASTDATE, CALCULATE

## What it does
CLOSINGBALANCEQUARTER returns the balance at the end of the quarter. Like the month version, it is the right tool for balances such as receivables, inventory, deferred revenue and accruals, which must not be added across time. Finance teams use it for the quarter-end balance sheet, the quarter-end aging of receivables and the quarterly reconciliation.

## Syntax and arguments
- expression: the measure or column that holds the balance. Required.
- dates: the date column of the Calendar table. Required.
- filter: an optional filter, such as a region or a customer segment. Optional.

## Example
A controller prepares the quarter-end aging of receivables. The AR snapshot has the open balance for each customer on each day, so the quarter-end balance is the balance on the last day of the quarter.

```dax
Closing AR Q = CLOSINGBALANCEQUARTER(SUM('AR_Snapshot'[Balance]), 'Calendar'[Date])
```

In a Q3 2026 row, the measure returns the receivables on September 30, 2026. Summing the three months' balances would give a figure that means nothing.

## Example: a second, different use
Quarter-end inventory value for one warehouse, with the filter placed inside the function.

```dax
Inventory Value Closing Q =
CLOSINGBALANCEQUARTER(
    SUM('Inventory'[Value]),
    'Calendar'[Date],
    'Inventory'[Warehouse] = "Dallas"
)
```

## Things to watch
- The function uses calendar quarters. A fiscal quarter needs a filter on the fiscal columns of the Calendar, and the result must be checked against the fiscal close.
- The last day of the quarter must have a snapshot row. A missing row gives a blank.
- Use only on balance data. A list of transactions does not give a running balance this way.
- The Calendar must cover every quarter end.

## In business terms
CLOSINGBALANCEQUARTER supports the quarter-end balance sheet, the aging of receivables at each quarter end, quarter-end inventory counts, and the balances used in covenant and borrowing base reports. Lenders often ask for quarter-end figures, so the measure must match the closing trial balance.
