TOTALYTD to use date field not literal string

OK, maybe I am missing something obvious… how do I change the “6/30” literal string to use a table field instead?.

= TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL(‘DateTime’), “6/30”)

Dates table:
Dates[Date] (Date format)
Dates[Year End] (Date format)

Isnt the last argument the day and month that the financial year ends, so you would be storing a full column of the same value?

Would storing it as a VAR using FORMAT to change the formatting and casting it to text and calling it in the function work

Hi @kylie.oconnell , will give it a go. Dates has several YearEnds in, I.E. Calendar Year End, Fiscal Year End, Operations Year End etc…

Hi @marcster_uk - As per my knowledge TOTALYTD takes a literal string as year-end date and it is not possible to enter a dynamic value. I have tried myself and I can’t put dynamic value.

Best option is to use a different dax function other than TOTALYTD. Do let me know if you find any option to make it dynamic.

Thanks
Ankit J

Would it not be possible to do something similar to what Ankit suggests, and add a column to the date table for Fiscal Year, Operations Year etc, and use the normal calculate pattern where you capture the selected value of the Operations Year and the date, and then the filters in calculate would be date is less than the selected date, and the operations year equals the selected operations year, or use dates between using the current date and the min date for the current operations date to place the filter.

Hello @marcster_uk

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

Hi @marcster_uk

Just following up if you still require assistance to solve your inquiry.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.