Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Rsing
Frequent Visitor

What is difference between DatesYTD and TotalYTD in simple terms with example. lot of confusion.

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Rsing ,

DATESYTD and TOTALYTD are both DAX time intelligence functions in Power BI.

Common points:

1.can be used to calculate the year-to-date totals for a given metric. Specifically refer to the following format and link:

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

DATESYTD function (DAX) - DAX | Microsoft Learn

TOTALYTD(<expression>,<dates>[,<filter>][,<year_end_date>])

TOTALYTD function (DAX) - DAX | Microsoft Learn

2.There is an optional parameter <year_end_date>, if the value of this parameter is filled in "06/30", it means that the start of the calculation is July 1 of the current year, you can refer to the following link:

Basics of Time Intelligence in DAX for Power BI; Year to Date, Quarter to Date, Month to Date - RADA...

Different points:

1.The return value of DATESYTD is a table that contains a column of dates for that year-to-date in the current context.

TOTALYTD calculates the current calculation of the value of the expression in the context of the year-to-date value, return scalar results.

2.TOTALYTD can only add a filter, but DATESYTD and CALCULAT can be added in combination with a number of filter conditions, so DATESYTD more flexible than TOTALYTD. Although it is possible to add more than one filter using TotalYTD, it may make the expression a bit complicated, please refer to the following link for details:

The hidden secrets of TOTALYTD - SQLBI

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Rsing ,

DATESYTD and TOTALYTD are both DAX time intelligence functions in Power BI.

Common points:

1.can be used to calculate the year-to-date totals for a given metric. Specifically refer to the following format and link:

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

DATESYTD function (DAX) - DAX | Microsoft Learn

TOTALYTD(<expression>,<dates>[,<filter>][,<year_end_date>])

TOTALYTD function (DAX) - DAX | Microsoft Learn

2.There is an optional parameter <year_end_date>, if the value of this parameter is filled in "06/30", it means that the start of the calculation is July 1 of the current year, you can refer to the following link:

Basics of Time Intelligence in DAX for Power BI; Year to Date, Quarter to Date, Month to Date - RADA...

Different points:

1.The return value of DATESYTD is a table that contains a column of dates for that year-to-date in the current context.

TOTALYTD calculates the current calculation of the value of the expression in the context of the year-to-date value, return scalar results.

2.TOTALYTD can only add a filter, but DATESYTD and CALCULAT can be added in combination with a number of filter conditions, so DATESYTD more flexible than TOTALYTD. Although it is possible to add more than one filter using TotalYTD, it may make the expression a bit complicated, please refer to the following link for details:

The hidden secrets of TOTALYTD - SQLBI

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

gmsamborn
Super User
Super User

Hi @Rsing 

 

They are both time intelligence functions that rely on a well-formed date table.

 

These 2 measures return the same result.

 

YTD Sales =
	CALCULATE(
		[Sales],
		DATESYTD( 'Date'[Date] )
	)


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

 

https://dax.guide/totalytd/

https://dax.guide/datesytd/

 

Let me know if you have any questions.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.