I am currently having a problem trying to get my statement for Last Year values to work. I want to obtain the Cost Value for my Last Year data. It works just fine with this equation:
but when I adopt it to a pivot table and use it for other fields like % to Sales, I realized I had to have an aggregated function for the groupings. So I came up with this equation: