DATESYTD DAX Function

The function returns a single-column table that contains dates for the year-to-date (YTD) in the current filter context. For example, if the first date in the input parameter is 7 July 2008, then it returns all the dates from 1 Jan 2008 to 31st Dec 2008 as by default the year_end_date is 31st December.

DAX Syntax DATESYTD(dates [,year_end_date])

The function takes the following parameters:
• dates: A column that contains dates. • year_end_date (optional) : A literal string with a date that defines the year-end date. The default is December 31.

Example: The following sample formula creates a measure that calculates the running total of the annual income.

DAX

The DatesYTD function = CALCULATE(SUM(Sheet8[Annual Income]), DATESYTD('Sheet8'[Year]))