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
lcd
Frequent Visitor

TOTALYTD with 4 parameters

Hi, I'm a newby in powerbi and DAX. I have a measure that WORKS FINE but it has more parameters than it should have.

My measure is:

TOTALYTD(sum(GASTOS[IMPORTE]);GASTOS[FECHA];YEAR(GASTOS[FECHA]) = YEAR(TODAY());GASTOS[FASE]="100")

 

The  DAX reference for TOTALYTD is:

TOTALYTD(<expression>,<dates>[,<filter>][,<year_end_date>]) 

and only let to use ONE FILTER.

What I don't understand is WHY the function works fine with 2 filters:

YEAR(GASTOS[FECHA]) = YEAR(TODAY());GASTOS[FASE]="100"

 

Thanks in advace

 

 

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@lcd

 

The fourth argument to TotalYTD is not a filter at all. It is a string specifying a year end date in order to calculate TotalYTD for fiscal year instead of calendar year. So we should not use another filter for the fourth argument. However, when you specify a filter condition, the intellisense signals that it is an error, but DAX engine is more tolerant during execution time which doesn’t sound like a good idea as it confused you. Power BI Team will file an internal bug to consider rejecting such expressions by the DAX engine. Thanks for reporting this.

 

Best Regards,

Herbert

View solution in original post

2 REPLIES 2
v-haibl-msft
Employee
Employee

@lcd

 

The fourth argument to TotalYTD is not a filter at all. It is a string specifying a year end date in order to calculate TotalYTD for fiscal year instead of calendar year. So we should not use another filter for the fourth argument. However, when you specify a filter condition, the intellisense signals that it is an error, but DAX engine is more tolerant during execution time which doesn’t sound like a good idea as it confused you. Power BI Team will file an internal bug to consider rejecting such expressions by the DAX engine. Thanks for reporting this.

 

Best Regards,

Herbert

v-yuezhe-msft
Employee
Employee

Hi @lcd

I can reproduce your issue, I will report this issue internally and post back once I get any updates.

Thanks,
Lydia Zhang

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