TOTALYTD Function (DAX)

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

TOTALYTD(
     <expression>,<dates>[,<filter>][,<year_end_date>]
)

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

 

Considerations when using the TOTALYTD function

Remarks

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

TOTALMTD
CALCULATE
TOTALQTD
DATESQTD

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI