I am trying to write a variable for the current year. Here is what I would like but it does not work. Please help me with the last part. I must admit to being fairly behind in learning to write variables into calculations. Our data has not really needed them and is pretty straight forward. I need to write one, now, though, quicker than it would take for me to learn them. Can someone help me write the following variable calculation.
Partial Prior Year =
FullYear = if the Max of ‘SalesPerformance'[OrderDate] is in the current year
else “Yes” || “No”
Calculate([Last Year Booked], [IsBeforeToday] = FullYear)
Basically, if the max order date is in the current year, I want to filter the calculation to dates that are before today and if the max order date is in a prior year, I do not want to filter any of the dates.
Here is what I used. I think I was making it too complicated.
Partial Prior Year = IF(YEAR(MAX([OrderDate]) = YEAR(TODAY())),
CALCULATE([Last Year Booked], FILTER(DimDate, [Is Before Today]=1)), CALCULATE([Last Year Booked], ALL(DimDate[Is Before Today])))