Amazon Quicksight Time intelligence functions

609 Views Asked by At

This is my first time using amazon quicksight and I am having trouble creating a calculated measure that brings in sales from the year before the one I am evaluating in each row.

Example:

https://i.stack.imgur.com/knB56.png

I am looking for the simile to the function CALCULATE (SUM (SALES), PREVIOUSYEAR ()) of PowerBi

1

There are 1 best solutions below

1
Frank Servy On BEST ANSWER

I am afraid this is not a complete solution but hopefully it will put you in the right direction.

I started with the following dataset: enter image description here

In Quicksight, I prepared my data by calculating the Year and Month fields from the Date field of my dataset. I then defined the following calculated field:

lag(sum(SALES), [Month ASC], 1)

I was then able to get the following result: enter image description here

As mentioned, this is a partial answer as it doesn't work for May 2019 (it should be null/empty instead of 19). It might be easier to work with dates field rather than Month/Year string fields the way I did. I hope this will be of some help.