Downloads
DAXTime intelligence: to dateIntermediate

DATESMTD

Returns a table of dates from the first day of the month up to the last date in the filter context.

Syntax
DATESMTD(<dates>)

Returns: A table of dates, used as a filter inside CALCULATE.

What it does

DATESMTD returns the dates from the first day of the current month to the last date in the context. CALCULATE uses them as a filter, so any measure can be shown month to date. It is the most flexible of the month-to-date tools, because other filters and date shifts can be combined with it.

Syntax and arguments

Example

A payroll team wants to see payroll paid so far this month, for a mid-month cost review. The payments are in a table related to the Calendar.

Payroll Paid MTD =
CALCULATE(
    SUM('Payroll'[NetPay]),
    DATESMTD('Calendar'[Date])
)

In a view for October 15, 2026, the filter covers October 1 to October 15. The figure resets on the first of each month.

Example: a second, different use

Expenses month to date for one cost center, compared with the same days of the prior month. The date filter and the cost center filter work together.

Expenses MTD Prior Month =
CALCULATE(
    SUM('Expenses'[Amount]),
    DATEADD(DATESMTD('Calendar'[Date]), -1, MONTH),
    'Expenses'[CostCenter] = "Sales"
)

If the current view runs from October 1 to October 15, the prior-month figure covers September 1 to September 15 for the Sales cost center.

Things to watch

In business terms

DATESMTD supports month-to-date expense control, payroll cost tracking, cash position reports during the close and the mid-month flash. It gives the controller an early view of the month and a fair comparison with the prior month.

Related functions

All DAX functions · View as Markdown · DAX fundamentals