cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
oldhasbeen Regular Visitor
Regular Visitor

TOTALYTD - erroneous calculation

I've found an oddity using TOTALYTD.

 

I've set up a measure Sales YTD = Calculate(TOTALYTD(SUM(Sales[Sale£]),Sales[OrderDate]))

 

And used it in a table:

 

YTD Issue.PNG

I've checked the Sales YTD against the source data - that for Arrowroot is incorrect., there are zero sales of Arrowroot in 2019, so DAX has given us the 2018 total instead (!):

 

Arrowroot issue.PNG

Any suggestions how to resolve this?

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: TOTALYTD - erroneous calculation

@oldhasbeen for time intelligence calculations like TOTALYTD , it is best practice to add date dimension in your data model. THere are many blogs on how to add date/calendar dimension in your data model. After you have date dimension, set relationship on date between date and sales table and change your measure to use Date from new dimension instead of OrderDate





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




1 REPLY 1
Highlighted
Super User
Super User

Re: TOTALYTD - erroneous calculation

@oldhasbeen for time intelligence calculations like TOTALYTD , it is best practice to add date dimension in your data model. THere are many blogs on how to add date/calendar dimension in your data model. After you have date dimension, set relationship on date between date and sales table and change your measure to use Date from new dimension instead of OrderDate





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.