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
Anonymous
Not applicable

YTD with a custom calendar?

Hi everyone,

 

I've read several posts about usage of YTD formula, but still have some doubts.

 

I need to find a way to calculate a sum of CFU gained during the academic year. For the current ac.year it's quite straighforward, but then I need to compare this CurrentYearSum with 5-10 previous years, i.e. from the start of each academic year *in the past* till the current DayMonth that year in the past. For example, in academic year 2016/2017 by 01/03/2017 there are X CFU gained, I need to calculate the same measure for academic year 2015/2016 till the 01/03/2016. The end date is defined by the user by applying slicers.

 

This is the definition of academiс year that brings confusion: it lasts more than one calendar year, e.g. starts on 01/11/2015 and ends on 01/05/2017  (547 days).  

 

 

After reading some articles on the topic, I'm not sure whether it is possible to use these functions with such custom calendar at all. If yes, could someone please give me any general directions, how this can be implemented? Or what can be the point to start with?

 

Thank you!

 

3 REPLIES 3
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Maybe you could try "TotalYTD" and "Sameperiodlastyear".

Something like this:

 

TotalYTD =
TOTALYTD (
    SUMX ( Sales, Sales[Quantity] * Sales[Unit Price] ),
    'Date'[Date],
    "03-01"
)
TotalYTDLastyear =
CALCULATE ( [TotalYTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )

YTD with a custom calendar.jpg

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-jiascu-msft , thank you for the explanation.

It doesn't solve my problem, but the only reason I think is because it is in general can't be solved with YTD formulas.

vanessafvg
Super User
Super User

@Anonymous you can tell it when your year operates ie

 DATESYTD(‘Date'[Date],”03-01″)

 

but in terms of the length of time i dont think so

 

the best thing to do is create and indicator for the year and custom cummulators of your measures perhaps?

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.