DATESMTD DAX Function in Power BI

The DATESMTD DAX Function returns a table that contains a single column of dates with dates from the start of the current month to the latest date in the current context. The dates returned are coming from the given column of dates as the parameter in the function.

For example, if the date returned after context filter is 7 July 2009, then it returns all the dates from 1 July 2009 to 7th July 2009, provided those are available in the given dates column.

DAX Syntax DATESMTD(dates)

The parameter dates is a column containing dates.

Example: Let’s we have the following table named Sheet1 and we have Dates column in it with Date data type.

DATESMTD dax function in Power BI

The following sample formula creates a measure that calculates the Month To Date Total.

DAX

DATESMTD Measure = CALCULATE(SUM(Sheet1[10th Marks]), DATESMTD('Sheet1'[Dates]))

The output of the above dax function is shown below:

DATESMTD dax function in Power BI