Showing results for 
Search instead for 
Did you mean: 
Stroopwafels Frequent Visitor
Frequent Visitor

How to correctly adjust your YTD formula?

Hello everyone, 


I need your help with my YTD formula: 


YTD = CALCULATE(TOTALREVENUES[salesdata]; DATESBETWEEN(salesdata[date_processed]
; DATE( year(MAX(salesdata[date_processed])); 1;1)
; DATE( year(MAX(salesdata[date_processed])); month(lastdate(all(salesdata[date_processed]))); day(LASTDATE(all(salesdata[date_processed]))))))


The below formula was working for me last year but since this year, the formula is comparing 5th january 2018 with 4th of january 2017 while 5-1-2018 is on a friday and 4-1-2017 is on a wednesday. 


Can anyone please help me? 



v-xjiin-msft Super Contributor
Super Contributor

Re: How to correctly adjust your YTD formula?



In your scenario, as you said that your YTD formula is comparing 2018-1-5 with 2017-1-4. Then what’s wrong with it? What’s your expected result?


I’m not quite understand about your requirement. Please elaborate your issue by sharing us more information like some sample data and your desired output. Otherwise, we can only make a guess.


By the way, to calculate the YTD value. I don’t think you need to specify such complicate formula. Please refer to TOTALYTD Function.


Xi Jin.

Helpful resources

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 309 members 2,869 guests
Please welcome our newest community members: