DATESMTD Function (DAX)

How does the DATESMTD function (DAX) work?

The DATESMTD function (DAX) returns a table that contains a column of the dates for the month to date, in the current context.

DATESMTD Formula Syntax

DATESMTD(
     <dates>
)

How do you use the DATESMTD function?

The DATESMTD function can be used to calculate the running total for the month for the given day number.

Related Blog Posts

Related Support Forum Posts

YTD and PYTD issue, potentially using the EDATE function somehow?
Month To Date Comparisons

Considerations when using the DATESMTD function

The dates argument can be any of the following:

  • A reference to a date/time column.
  • A table expression that returns a single column of date/time values.
  • A Boolean expression that defines a single-column table of date/time values.

Related Video Tutorials

Formula examples using the DATESMTD function

=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), DATESMTD(DateTime[DateKey]))

=CALCULATE(Sum(Sales[Revenue]),DATESMTD(Sales[Date]),AllExcept(Sales,Sales[Product])).

= CALCULATE ( SUM (Sales [Sales Amount]), DATESMTD (Sales [Date]) )

Related DAX Functions

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.