Home » DAX » DAX – TOTALMTD Function

DAX – TOTALMTD Function

TOTALMTD DAX

Evaluates the value of the expression for the month to date, in the current context. It’s comes under Time Intelligence Dax function category.

Syntax:

TOTALMTD(<expression>,<dates>,<filter>)

Description:

S no. Parameter Description
1 expression An expression that returns a scalar value.
2 date A column that contains dates.
3 filter (optional) An expression that specifies a filter to apply to the current context.





So, Let’s start with an example, download the sample Dataset from below link

Step-1: Create a calendar table to using existing dataset “Order Date” column.

Go to Modeling Tab > Click to table icon & write below DAX

Calendar = 
CALENDAR(MIN('Global-Superstore'[Order Date]), 
MAX('Global-Superstore'[Order Date]))

Step-2: After that create a relationship between both table.

Relationship




Step-3: Now, creates a measure to calculate the ‘month running total’ or ‘month running sum’ for sales.

MTDSales =
TOTALMTD(SUM('Global-Superstore'[Sales]), 'Calendar'[Date])

Step-4: Drag MTDSales measure and Year, Month column from Calendar table & Sales from Global-Superstore table.

TotalMTD

TotalMTD

As you see in above screen shot it returns the month running total for January Month sales & for next month it will start sales summation from the beginning.

TOTALMTD DAX - 2

TOTALMTD DAX – 2

Recommended Post: TOTALQTD DAX




Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.

Leave a Reply