Calculation field - What formula needs to be added to view YOY % Change

Hello! I am trying to create a field to view the % change in product type YOY. I have 4 columns, where one of them is a sum (total - product type) for each year. Followed by a column for brand, year and product type. I need to create a visual where I can view the brand, the product type and its total for each year and then finally get a column where I can see the % YOY increase/decrease in sales in relation to the previous year.

Hello @akshaym, welcome to the QuickSight community. One thing I know for sure is that you are going to want to use the calculation for periodOverPeriodPercentDifference that is native to QuickSight in a calculated field. Here is a link to the documentation that exists for this function.

Here is what I think the best process would be to accomplish this:

  • Create a calculated field to get your sum of sales per product, it will look like this sumOver({Sales}, [{Brand}, {Product Type}], PRE_AGG)
  • Now create your periodOverPeriodPercentDifference calculation like this periodOverPeriodPercentDifference(sum({Sales by Product}), {Date}, YEAR, 1)
  • Then in your table make sure you have Date (Aggregated as year by selecting the dropdown in the field well if it isn’t already converted), Brand Name, Product Type, and Total in your table then add your YOY% calculation and sort by brand name from a-z.

This should show you the results you want! Let me know if that helps!

1 Like

Hello @DylanM, the solution you gave works to get the YOY% change.

Thanks a lot. Appreciate your help.

2 Likes

Thanks for letting us know that @DylanM’s solution worked @akshaym! :slight_smile:
And thanks @DylanM for sharing your expertise!

1 Like