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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
srk_powerbi
Helper II
Helper II

custom YTD calculation help

hi,

I want to calculate YTD, Previous YTD sales total calculations. But here in my date table, Fiscal year start from 01/05/2021 for year 2021 and for each year it is different. I have two columns  for 'FiscalYearStartDate' and 'PreviousFiscalYearStartDate'. How do i calculate YTD and Previous YTD sales total in this case?

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @srk_powerbi ,

You could try the following measure:

YTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[FiscalYearStartDate]&&'Table'[Date]<=NOW()))
PREYTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[PreFiscalYearStartDate]&&'Table'[Date]<=NOW()))

 

v-luwang-msft_0-1621912017590.png

 

Wish it is helpufl for you!

 

Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @srk_powerbi ,

You could try the following measure:

YTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[FiscalYearStartDate]&&'Table'[Date]<=NOW()))
PREYTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[PreFiscalYearStartDate]&&'Table'[Date]<=NOW()))

 

v-luwang-msft_0-1621912017590.png

 

Wish it is helpufl for you!

 

Best Regards

Lucien

amitchandak
Super User
Super User

@srk_powerbi , You can use enddate in datesytd. This means start year from first april

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"4/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"4/30"))

 

if you need FY calendar then refer my blog, for any month start calendar

Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors