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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
Anonymous
Not applicable

YTD Function

Hello

 

I am trying to use the TOTALYTD formula as below to create a YTD measure (my year end is January) and when i pull the measure into a table by date, it works. However, when i filter by month or quarter, it appears empty and doesn't work. 

 

Has anyone encountered this before?

 

YTD FY21 Sales = TOTALYTD([Actual FY21],'Calendar'[Date],"01/31")

 

Spacewalker_0-1629198253674.png

Spacewalker_1-1629198282640.png

Appreciate your advise! thank you!

8 REPLIES 8
Anonymous
Not applicable

Hi @Tanushree_Kapse 

Thanks for your reply. I already have the full set of dates in place but still it doesn't work..

My date table runs from 1 Feb 2020 until 31 Jan 2022, representing two full fiscal year.

 

Is that considered full set?

 

thank you!

 

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!

Anonymous
Not applicable

Hi @Tanushree_Kapse 

 

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!!

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

Anonymous
Not 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")

 

Spacewalker_0-1629276090101.png

 

Spacewalker_1-1629276158335.png

Appreciate your advise! thank you!!

 

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

Anonymous
Not applicable

Hi @Anonymous  

 

Thanks for your advise!

In this case, how do I change the formula for FY21 to show the YTD total value in card visual?

 

Thank you!

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

TOTALYTD works only if you have the full set of dates in the given time.

 

 

Mark this as a solution if I answered your question. Kudos are always appreciated.

Thanks!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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