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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
webportal
Impactful Individual
Impactful Individual

DAX TOTALYTD fiscal year third argument necessary

Hello,

 

In my data model I have a custom fiscal calendar (begins on jul-1).

 

For the YTD calculation, I'm using a measure like:

 

Faturação YTD Fiscal = TOTALYTD(SUM(Factos[Faturação]);'CalendárioFiscal'[Date];ALL('CalendárioFiscal'[Date]);"06/30")

This works well, but I don't understand why I need the 3rd and 4th argument, since the function returns the same values without these as long as the fiscal calendar exists. Are these argumens necessary at all or are they meant to be used if there's no fiscal calendar?

 

Also, if the 4th argument is there, the 3rd is also mandatory. Why?

 

Thank you!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@webportal,

What is the data range of your fiscal calendar ? Assume it begins on July-1 and ends on June-30, I make a test using your DAX and the following DAX, they return different results.

Faturação YTD Fiscal 1 = TOTALYTD(SUM(Factos[Faturação]);'CalendárioFiscal'[Date])

2.JPG1.JPG

In addition, the third and fourth arguments are optional so they are not necessary in TOTALYTD() function. The filter(3rd) parameter is an expression that specifies a filter to apply to the current context and the year_end_date(4th) parameter is a literal string with a date that defines the year-end date.

 

Moreover, if the 4th argument is there, the 3rd is not mandatory. And if you need the 4th argument depends on that what data you would like to get from the measure, please check the above screenshots. If you have any questions, please share sample data of your data table and fiscal calendar table.



Regards,
Lydia

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

View solution in original post

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@webportal,

What is the data range of your fiscal calendar ? Assume it begins on July-1 and ends on June-30, I make a test using your DAX and the following DAX, they return different results.

Faturação YTD Fiscal 1 = TOTALYTD(SUM(Factos[Faturação]);'CalendárioFiscal'[Date])

2.JPG1.JPG

In addition, the third and fourth arguments are optional so they are not necessary in TOTALYTD() function. The filter(3rd) parameter is an expression that specifies a filter to apply to the current context and the year_end_date(4th) parameter is a literal string with a date that defines the year-end date.

 

Moreover, if the 4th argument is there, the 3rd is not mandatory. And if you need the 4th argument depends on that what data you would like to get from the measure, please check the above screenshots. If you have any questions, please share sample data of your data table and fiscal calendar table.



Regards,
Lydia

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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