DAX code
Year-to-Date Sales =
-- 'Date'[Date] must come from a table marked as the model's official date table
TOTALYTD([Total Sales], 'Date'[Date])
Accumulates sales from the start of the current year up to the latest selected date.
Type your table and column names once. Every measure below updates.
Year-to-Date Sales =
-- 'Date'[Date] must come from a table marked as the model's official date table
TOTALYTD([Total Sales], 'Date'[Date])
Generate a Power BI date table
'Date' must be marked as a Date Table in Power BI (Table tools > Mark as date table), with a continuous, gap-free Date column.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Year-to-Date Sales.