Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Stroopwafels
Regular 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? 

 

Cheers, 

1 REPLY 1
v-xjiin-msft
Solution Sage
Solution Sage

@Stroopwafels

 

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.

 

Thanks,
Xi Jin.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.