I'm having trouble understanding how powerbi computes TOTALYTD. I think powerbi understands that the current year is the last one in the database.
I have a test database with Actual & Budget Data for 2 countries. I have 2016 & 2017 Actual Data and 2018 Budget Data.
If I compute a B18 YTD like this :
TOTALYTD([Total_Budget];'Date'[Date])
This works well.
However I cannot compute YTD for 2016 and 2017 actual data, it always returns 0. I tried filtering using DATESBETWEEN
but same result. I am forced to use this :
A17 YTD = CALCULATE([Total_Actual];DATESBETWEEN('Date'[Date];Date(2017;1;1);LASTDATE(DATEADD('Date'[Date];-1;YEAR))))
How can I modify the year context in a dax expression so as to use the TOTALYTD function ?
I don't want to modify every YTD function each time I add a new budget year. (I must add 2019 & 2020 budget data)