How to compare sum e.g. on yearly basis in columns?

Hi there,

how can I compare two or more columns which each other and create a field which shows the difference of the value of these two columns?

You have several scenarios with costs forecasts. In Quicksight you want to compare the costs on yearly basis of these scenarios.

Has someone an idea how to solve this?

2023-10-17 19_20_30-prod analysis

Thank you very much

Hi @de.schmidd ,

There are a couple ways to do this:

  1. Create a calculated field and use the periodOverPeriod functions. For instance you can create a ‘sales difference’ as follows:

periodOverPeriodDifference(sum({Sales}), {TransactionDate}, MONTH, 1)

There’s a handful of these functions for different scenarios, like periodOverPeriodSum(), periodOverPeriodAvg(), etc

  1. You can add a table calculation to a pivot table from any of the Values:

Screenshot 2023-10-17 at 3.12.26 PM

And notice that you have the option on how it’s calculated with the ‘Calculate As’ option.

Hope that helps!


1 Like