DATESYTD Function (DAX)

How does the DATESYTD function (DAX) work?

The DATESYTD function (DAX) returns a table that contains a column of the dates for the year to date, in the current context.

DATESYTD Formula Syntax

DATESYTD(
     <dates> [,<year_end_date>]
)

How do you use the DATESYTD function?

The DATESYTD is used to calcute the year to date value. This function can be used with CALCULATE function to combine multiple filter criteria together.

Related Blog Posts

Related Support Forum Posts

Dashboard Chart Selection Date to drive Sales YTD and Sales LY YTD
YTD and PYTD issue, potentially using the EDATE function somehow?
Visual Has Exceeded Available Resources

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

Related Video Tutorials

Formula examples using the DATESYTD function

=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), DATESYTD(DateTime[DateKey]))

= CALCULATE(SUM(incidents[Value]);DATESYTD(incidents[Date]);ALL())

= CALCULATE( SUM(FactInternetSales[SalesAmount]), DATESYTD( FactInternetSales[OrderDate].[Date] ) )

Related DAX Functions

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


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
Membership