Forum Discussion
YTD for previous year
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
I tried several different calculations, but nothing works. I 've given it a lot of time but i do not have the feeling that I really understand how the syntax works. I've applied the syntax in Time Intelligence "The Hard Way" in the next measure and tried to compute a first date, last date and row count on the date table in order to check if the calculation is correct.
VAR MAX_Year=
The rowcount suggests that not all rows are counted in the datetable that are before the last date of each period in this or previous year (not really a ytd, but a count of all mutations over all years). What I want to achieve is to:
- Filter the date table with dates <= this year (and in the other measure <= previous year)
- Apply visual level filter (periods, weeks) (So the max date will only return the max date of a period,week in this year)
- Filter the date table to return all dates <= max date for each period,week
- Calculate on facttable filtered on dates based on previous steps
Perhaps I need to find another approach, or is this possible? Because periods can vary in start- and enddate I cannot use standard time based calculations I guess.