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

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! Appreciate your Kudos Smiley Happy
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! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 259 members 2,700 guests
Please welcome our newest community members: