TOTALYTD (Year-to-Date)

Power BI · Advanced DAX & Time Intelligence

Theory

Year-to-date sums a measure from the start of the year up to the last date in the current filter context. TOTALYTD(expression, dates) does this in one function; it is equivalent to CALCULATE(expression, DATESYTD(dates)). The dates argument should be the date column of a marked date table, such as 'Date'[Date], with a relationship to the fact table.

In a visual by month for 2024, the January row shows January's sales (₹1,200), February shows January plus February (₹3,500), March ₹5,700 and April ₹6,200, so the line keeps growing through the year and restarts each January. For a financial year that ends on 31 March, common in India, pass the year-end date as the last argument: TOTALYTD([Total Sales], 'Date'[Date], "3-31"). Related functions are TOTALMTD and TOTALQTD for month- and quarter-to-date.

Why we use it

Leaders track progress against annual targets, so YTD is one of the most requested measures. TOTALYTD gives a correct running total that respects the calendar and slicers.

When to use it

Use it for any cumulative-to-date figure within a year. Use DATESYTD inside CALCULATE when you need to combine it with other filters. For a running total that never resets, use a different pattern with FILTER over ALL dates.

How it works

  1. Visual cell for a month
  2. Find the last date in the current context
  3. Build the set of dates from 1 Jan (or FY start) to that date
  4. Evaluate the measure over those dates
  5. Next month in the same year? Yes: Total keeps growing. No: Total restarts in the new year.
  6. YTD shown per month

Syntax

TOTALYTD(<expression>, <dates>[, <filter>][, <year_end_date>])
CALCULATE(<expression>, DATESYTD(<dates>[, <year_end_date>]))
TOTALQTD / TOTALMTD(<expression>, <dates>[, <filter>])

Example

Sales YTD = TOTALYTD([Total Sales], 'Date'[Date])

// Same result with CALCULATE
Sales YTD (calc) = CALCULATE([Total Sales], DATESYTD('Date'[Date]))

// Indian financial year (April to March)
Sales FYTD = TOTALYTD([Total Sales], 'Date'[Date], "3-31")

Key points

Power BI topics

Power BI Introduction

Getting Data

Power Query (Data Transformation)

Data Modeling

DAX (Data Analysis Expressions)

Data Visualization

Dashboards & Reports

Power BI Service

Advanced Features

Projects & Case Studies

Interview & Certification

Advanced DAX & Time Intelligence

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Power BI Dashboards & DAX

Learn data visualization and interactive dashboards step-by-step. Click any topic in the sidebar to open it right here.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice DAX Online 250 business scenarios on a star schema — write a measure and compare your visual with the expected one. Start practising →
Section {{ sec.num }}

{{ sec.label }}

Power BI  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
On screen — where to click

{{ rich.ui.title }}

{{ u.text }}
  1. {{ st.n }}{{ st.text }}
{{ rich.ui.title }}
{{ u.text }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax / Where to find it
{{ current.syntax }}
Example
{{ current.example }}
What You'll Learn — click to check off
  • {{ pt.mark }} {{ pt.text }}

Share this topic