<!-- https://learnsql.cpetoday.com/functions/dax/endofmonth -->
# ENDOFMONTH

Language: DAX
Category: Time intelligence: first and last
Syntax: ENDOFMONTH(<dates>)
Summary: Returns the last date of the month that contains the dates in the filter context, as a one-row table.
Returns: A table with one date, used as a filter inside CALCULATE.
Level: Intermediate
Related: STARTOFMONTH, LASTDATE, EOMONTH, ENDOFQUARTER, CLOSINGBALANCEMONTH

## What it does
ENDOFMONTH returns the last day of the month in context as a single date. Inside CALCULATE it limits the measure to that day, which gives the balance at the close of the month. Finance teams use it to read month-end balances from a snapshot table, such as receivables, inventory or cash. For the same result with a built-in check, CLOSINGBALANCEMONTH is usually simpler.

## Syntax and arguments
- dates: the date column of the Calendar table. Required.

## Example
The controller reads the receivables balance at each month end from the AR snapshot, to tie the aging report to the general ledger.

```dax
AR Balance Month End =
CALCULATE(
    SUM('AR_Snapshot'[Balance]),
    ENDOFMONTH('Calendar'[Date])
)
```

In an October 2026 row, the measure reads the balance on October 31, 2026. If that day has no snapshot row, the result is blank, so check the snapshot coverage before you use it.

## Example: a second, different use
The month-end date as a label for a table of monthly closing balances, with the day used as a fixed reference.

```dax
Month End Date = CALCULATE(MIN('Calendar'[Date]), ENDOFMONTH('Calendar'[Date]))
```

## Things to watch
- ENDOFMONTH is a date filter, not the EOMONTH date function. EOMONTH takes a start date and a number of months and returns a date. ENDOFMONTH works on the filter context.
- If the snapshot has no row on the last day, use LASTNONBLANK or CLOSINGBALANCEMONTH.
- It picks one day. Use TOTALMTD or DATESMTD for a total.
- Keep it inside CALCULATE.

## In business terms
ENDOFMONTH supports month-end balances for the close, reconciliation of subledgers to the general ledger, and the monthly balance trend in the management pack. It is the standard way to show a balance as of the close.
