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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KH_Mike
Helper III
Helper III

Assigning Start & End for Year To Day Calculation

Hi All,

 

I have a set of data which like below. Right now, I would like to calculate the Year to Day by Fiscal Year (Starting from 1st April). Is it possible to calculate the YTD by starting from Fiscal Year and end from four month before max month?

 

Like below example, I would like to sum from (2021-04 to 2021-07). Then later when I got the data for 2021-08, the YTD will sum from (2021-04 to 2021-08). Thank you.

 

DateAmount
2020-1210
2021-0120
2021-0230
2021-0340
2021-0450
2021-0560
2021-0670
2021-0780
2021-0890
2021-09100
2021-10110
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@KH_Mike , Based on what I got.

You can use datesytd

 

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

 

You can have these column in date tbale

Start Year = STARTOFYEAR('Date'[Date],"3/31")

End Year = ENDOFYEAR('Date'[Date],"3/31")

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@KH_Mike , Based on what I got.

You can use datesytd

 

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

 

You can have these column in date tbale

Start Year = STARTOFYEAR('Date'[Date],"3/31")

End Year = ENDOFYEAR('Date'[Date],"3/31")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.