cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

A Date Column Containing duplicate Date was specified in the call to function

Hi All,

 

I created a slicer which will have Month-Year(eg., oct-2019,Nov-2019 etc) and Year values(2019,2020,etc). I got this by creating calculated table.

 

Then i created Percentage Difference by year and then by Month.

 

When i tried in my local with sample data(csv) set it worked fine but when i connected to my backend i.e., oracle percent difference calculation was throwing error.

 

Provided my Percent Differencee for Year Formula

Year Percent Difference monthend% =
var YTD_Sales = CALCULATE(SUM('Calculated Table'[C_Sales]),DATESYTD('Calculated Table'[C_Sales_Date]),ALLEXCEPT( 'Calculated Table','Calculated Table'[C_Source_System],'Calculated Table'[Time_Dimension]))
var last_YTD_Sales = CALCULATE(SUM('Calculated Table'[C_Sales]),DATESYTD(ENDOFYEAR(dateadd('Calculated Table'[C_Sales_Date],-1,YEAR))),ALLEXCEPT( 'Calculated Table','Calculated Table'[C_Source_System],'Calculated Table'[Time_Dimension]))

return (divide(YTD_Sales,last_YTD_Sales)-1) *100

 

It was working fine in sample dataset.

 

Provided the error when it was connected to backend

 

Couldn't load the data for Visual

MDX Scipt Model (20,75) calculation error in Measure 'Table'[Year percent Difference]: A Date Column Containing duplicate Date was specified in the call to function. 'DatesYTD'. This is not supported

 

Thanks in Advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: A Date Column Containing duplicate Date was specified in the call to function

Hi @Prakash_Mathi ,

 

Actually there are duplicate values in your table ( same date in multiple rows ).And you are using time intelligence functions DATESYTD which in DAX need a separate date table/dimension.

You could create a calendar table with unique and continuous dates that cover all periods of your fact table.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: A Date Column Containing duplicate Date was specified in the call to function

Hi @Prakash_Mathi ,

 

Actually there are duplicate values in your table ( same date in multiple rows ).And you are using time intelligence functions DATESYTD which in DAX need a separate date table/dimension.

You could create a calendar table with unique and continuous dates that cover all periods of your fact table.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors