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.

Issue with TOTALYTD and Calendar Table

Hi,

 

Recently I am facing an error using TotalYTD() function.

 

My calendar table date is defined as CALENDAR("01-01-2015","12-31-2021"). TOTALYTD returns correct value.

 

If I change my Calenader date to CALENDAR("01-01-2015","03-31-2022"), TOTALYTD doesn't return a value.

 

Appreciate your help.

 

TIA,

Shaishav Merchant

Status: New
Comments
v-robertq-msft
Community Support

Hi,

Unfortunately, I can’t reproduce the same issue as yours after my test.

This is my test DAX formula and screenshots:

TOTALYTD = TOTALYTD(SUM('Table'[Amount]),'Date'[Date],ALL('Date'[Date]),"1/1")

vrobertqmsft_0-1624522338777.png

vrobertqmsft_1-1624522338780.png

 

I think you should check the DAX formula you used and the original table data to make sure there’s no problem first.

More info about the TOTALYTD function in DAX

 

Best Regards,

Community Support Team _Robert Qin

Shaishavm
Advocate I

@v-robertq-msft Thanks for your reply.

This is a bit puzzling, sharing below measure dax and screenshots.

 

My measure is;

YTDSales = totalytd(Posted_Sales_Invoice_Header[InvoiceAmt],CalendarTable[Date])

 

Calendar("01-01-2015","31-12-2021")

Shaishavm_0-1624618208992.png

 

Calendar("01-01-2015","31-12-2022")

Shaishavm_1-1624618381425.png

 

I am not sure, what is wrong here.

 

TIA

Shaishav

v-robertq-msft
Community Support

Hi, 

According to your sample picture, I think you should also check if the relationship between the Posted_Sales_Invoice_Header and your CalendarTable still exists after your update of the DAX formula. Because it can also be one of the potential reasons for this.

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

Shaishavm
Advocate I

@v-robertq-msft thanks again for your reply. Relationship exists between these tables.

The issue is only when I change end date of the calendar.