Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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:

 

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 (!):

 

Any suggestions how to resolve this?

 

Thanks!

 

  • Anonymous 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

1 Reply

  • Anonymous 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