Forum Discussion
YTD Function
Hi Anonymous ,
Sorry, I misunderstood your problem at first.
What you can do now is:
1) Create a seperate column for just the enddates of the particular months.
2) Create a Calendar Table using this new enddate column, with distinct dates.
CalendarTable= DISTINCT(Table[enddate])
3) Then use this table's column for your YTD measure:
YTD FY21 Sales = TOTALYTD([Actual FY21],'CalendarTable'[enddate],"01/31")
Create relationship between the tables using enddates.
Format the enddate to MMM-YY and use this column in your visual.
I hope this helps!
Mark this as a solution if I answered your question. Kudos are always appreciated.
Thanks!
Thanks for your advise. Let me try that later.
On another note, I manually built my calendar table in excel and load into PowerBI. Is that causing the issue I am facing?
In order to use the time intelligence DAX formula, is it a must to build calendar table within power BI using DAX?
Thank you!!
- Anonymous5 years agoNot applicable
It is not a must but considered the best practice to make a calendar table using DAX in Power BI for the best utilization of time intelligence functions.
You can use CALENDERAUTO()
Calendar Table = CALENDARAUTO(2)Here the argument '2' specifies the end of the fiscal year as in your case. It then creates the ideal date table by looking at the dates in your data model and the end of fiscal year you provided.
On a side note, can you please elaborate about the Month column you used here? There may be some issue with it.
Regards,
Aditya
- Anonymous5 years agoNot applicable
Hi Anonymous
I tried to build a proper calendar table and here is my latest table.
I used the following functions and by pulling Year on top and Month below in the field, i managed to view some data. However, i noticed that if i pull FY21 into a card visual, it showed blank but i can see numbers for FY22. When i looked at the table, it might be due to the 'total' value is missing in FY21. Do you know what is causing that? both years are using the same formula...
YTD FY21 = TOTALYTD([Actual FY21],'Calendar'[Date],"1/31")YTD FY22 Team Commit = TOTALYTD([Forecast Team Commit],'Calendar'[Date],"01/31")Appreciate your advise! thank you!!
- Anonymous5 years agoNot applicable
With TOTALYTD and DATESYTD functions, year-to-date is defined relative to the maximum value of Dates[Date] in the filter context. Since in the filter context of 'total' of FY21 table the maximum year is FY22, TOTALYTD() changed the filter on the calender table to the range of FY22 ie, 1st Feb 2022 - 31st Jan 2023 for which the measure '[Actual FY21]' may not have the values and thus returned blank. Similarly for the card visual, in the filter context, the maximum year is FY22 and '[Actual FY21]' may not have values in that range hence the card is also blank. This is what I think is happening.
Regards,
Aditya