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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Dave
Advocate I
Advocate I

DAX TOTALYTD() - Duplicate Date Error

I’m having issues with the DAX TOTALYTD() function. Here is my formula:

 

                YTD = TOTALYTD(SUM(SampleSheet[Value]), SampleSheet[Date])

 

However, I’m getting the error below when I try to display a simple table with the YEAR and YTD columns:

 

YTD Issue.png

 

Error Text: MdxScript(Model) (1, 41) Calculation error in measure 'SampleSheet'[YTD Value]: A date column containing duplicate dates was specified in the call to function 'DATESYTD'. This is not supported.

 

What is the best approach to resolve this issue of duplicate dates? The source data does have duplicate dates, but I want to retain the actual dates from my source data. I've done some searching for this issue online, but haven't been able to find a satisfactory answer yet. 

 

Here is a link to my .pbx file. Regarding the data source, the dates were taken from a Dynamics CRM system and I added some dummy data in the “Value” Column.

1 ACCEPTED SOLUTION
konstantinos
Memorable Member
Memorable Member

Actually there are duplicate values in your table..( same date in multiple rows )..plus you are using time intelligent functions TOTALYTD which in DAX need a seperate date table/dimention. 

 

So you need to create a date table ( one row for every date ) and relate that to SampleSheet[Date].

Then your formula will be   YTD = TOTALYTD(SUM(SampleSheet[Value]), Datetable[Date])

 

There are 3 at least ways to create - add a date table such as load it from an external source, create one in PQ with M language, create one in data model with DAX functions CALENDAR() or CALENDARAUTO()...A simple search in community or Google it will guide you for all solutions.

Konstantinos Ioannou

View solution in original post

1 REPLY 1
konstantinos
Memorable Member
Memorable Member

Actually there are duplicate values in your table..( same date in multiple rows )..plus you are using time intelligent functions TOTALYTD which in DAX need a seperate date table/dimention. 

 

So you need to create a date table ( one row for every date ) and relate that to SampleSheet[Date].

Then your formula will be   YTD = TOTALYTD(SUM(SampleSheet[Value]), Datetable[Date])

 

There are 3 at least ways to create - add a date table such as load it from an external source, create one in PQ with M language, create one in data model with DAX functions CALENDAR() or CALENDARAUTO()...A simple search in community or Google it will guide you for all solutions.

Konstantinos Ioannou

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors