0
votes

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)

1

1 Answers

0
votes

Have you tried to check if some other filter doesn't have impact on 'Date'[Date] column that restricts the data to some specific dates which are only in 2018. Also I assume that [Total _Actual] is a reference to a measure. Have you tried to repeat the code of a [Total_Actual] measure inside the A17 YTD Measure instead of referencing the measure?