YOY calculation got errased

I would like to know why when I add a year filter, it deletes my calculated YOY field in the table.

CODE: ((sumIf({Gross Shipped GMS }, AÑO = ‘2024’) - sumIf({Gross Shipped GMS }, AÑO = ‘2023’))/sumIf({Gross Shipped GMS }, AÑO = ‘2023’))

Hi @Geral

Welcome to the QuickSight community!

The issue you’re facing, where adding a year filter deletes the calculated YoY (Year-over-Year) field, occurs because of how filtering affects the data context for calculated fields. When you apply a year filter (e.g., selecting only ‘2024’), QuickSight only retains data for the filtered year. In this case, it removes the ‘2023’ data from the context, meaning that your calculated field no longer has access to both years (‘2023’ and ‘2024’). As a result, the calculation for YoY growth fails since it cannot retrieve values for both years simultaneously.

Your YoY calculation is dependent on data from both 2023 and 2024. When a year filter restricts the data to only a single year (e.g., 2024), the previous year’s value (e.g., 2023) is not available, causing the calculated field to break.

Consider using parameters instead of direct year filtering. Create two parameters for the start year and end year. This way, you have more control over which years are used for the calculation without entirely excluding them from the dataset.

Please refer to the below QuickSight documentation and community post this might be helpful for you.

1 Like

Hi @Geral

It’s been a while since we last heard from you. If you have any further questions, please let us know how we can assist you.

If we don’t hear back within the next 3 business days, we’ll proceed with closing this topic.

1 Like

Hi @Geral

Since we have not heard back from you, I’ll go ahead and close this topic. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for relevant information.

Thank you!