I am trying to solve for the code below
sum({$<CalendarYear = {$(#=max(CalendarYear))}>} [Spend])) /
sum(aggr(sum({$<CalendarYear = {$(#=max(CalendarYear)-1)}>} [Spend])) /
sum({$<CalendarYear = {$(#=max(CalendarYear)-1)},CalendarQuarter=,CalendarMonth=>} Qty)) *
sum({$<CalendarYear = {$(#=max(CalendarYear))}>} if(len(Subcategory)>0,Qty)), Material))
On top of this I want to add the below condition for spend in the numerator (highlighted in red):
Calculate spend in current year only when Material exists in "max(CalendarYear)-1" so I wanted to use an aggr function in Numerator?
Thanks,
Prakash