Forum Discussion
Custom YTD bug
Hi all,
So I added a custom YTD measure that starts on October. This works well for all years except 2021-2022, where it start correctly on October but it resets and restarts summing from January 2022
I am going crazy trying to figure it out
https://drive.google.com/file/d/1KL-oKusVkU8H-89bax_rRbnQER1SkPfa/view
I will greatly appreciate any help
5 Replies
- Ashish_MathurSuper User
Hi,
I get an access denied message when i click on that link.
- PowerBITestingGResolver I
Sorry, you should have access now
- Ashish_MathurSuper User
- amitchandakSuper User
PowerBITestingG , Access denied to the file
But you can use time intelligence. Make sure you date table have date till the end of FY
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"9/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"9/30"))or
This FYTD=
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min =if( Month(_max) <10 , date(year(_max)-1,10,1) ,date(year(_max),10,1)), //FY April -March
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))This FLYTD=
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max = date(year(_max)-1,month(_max),day(_max))
var _min =if( Month(_max) <10 , date(year(_max)-1,10,1) ,date(year(_max),10,1)), //FY April -March
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))FY Calendar - https://medium.com/chandakamit/cheat-sheet-calendar-of-any-standard-month-just-one-variable-apart-5ee47de6a208
- v-xiaotangCommunity Support
I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.
If you need more help, please let me know.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.