DATESYTD
DatesYTD is a DAX function used in Power BI, Excel Data Model, and related environments to return a table of dates representing the year-to-date period for given dates. The function takes two arguments: dates, a column of dates to base the calculation on, and an optional year_end_date that defines the end of the fiscal year. If year_end_date is omitted, the year boundary defaults to December 31 of the year containing the date.
How it works: For each date in the dates column, DATESYTD returns the sequence of dates from
Example: TotalSalesYTD = CALCULATE(SUM(Sales[Amount]), DATESYTD(DimDate[Date])) Another example using a fiscal year end date: CALCULATE(SUM(Sales[Amount]), DATESYTD(DimDate[Date], DATE(2024, 6,
Notes: DATESYTD returns a table, not a scalar, and is intended to work with time-intelligence functions. For