How does the TOTALYTD function (DAX) work?

The TOTALYTD function (DAX) evaluates the year-to-date value of the expression in the current context.

TOTALYTD Formula Syntax


How do you use the TOTALYTD function?

This function calculates the cumulative subtotals in a year, also allows us to apply filters and specify a year end date.

Related Blog Posts

Related Support Forum Posts

Show sales YTD and the same for last year also
Current Month and YTD columns on Income Statement
Help with CALCULATE in Measure

Considerations when using the TOTALYTD 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.

The year_end_date parameter is a string literal of a date, in the same locale as the locale of the client where the workbook was created. The year portion of the date is not required and is ignored

Related Video Tutorials

Formula examples using the TOTALYTD function

=TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL(‘DateTime’), “6/30”)

= TOTALYTD ( [SalesAmount], ‘Date'[Date], 2008 )

= TOTALYTD ( [SalesAmount], ‘Date'[Date], CROSSJOIN ( TREATAS ( { “Red” }, Product[Color] ), TREATAS ( { “United States” }, Customer[CountryRegion] ) ) )

Related DAX Functions


Related Course Modules



Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.

Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide