Dynamic Date Ranges for KPI Current Sales and Previous Sales

Hello Experts,

I need assistance with setting up dynamic date ranges for comparing sales data. I have two measures on a KPI card:

Current sales KPI Card: To Show the current sum of sales of selected data range.
Previous Sales KPI Card: To show sum of sales from the equivalent previous period based on the user’s selected date range.

Requirement:

  • The Current Sales measure should display sales for the current period as defined by the date filter selected by the user (e.g., 1 April 2024 to 29 April 2024).
  • The Previous Sales measure should dynamically adjust to show the sales from the previous period that corresponds to the length and relative position of the current selection (e.g., if 1 April 2024 to 29 April 2024 is selected, it should automatically show 1 March 2024 to 29 March 2024).

Example Scenarios:

  1. If a user selects 1 April 2024 to 29 April 2024 for the current period, the dashboard should automatically show sales from 1 March 2024 to 29 March 2024 as the previous period.
  2. If a user selects 2 August 2024 to 4 September 2024, the previous period should adjust to 2 July 2024 to 4 August 2024.

I am looking for guidance on how to set up these dynamic date calculations to reflect accurately on the KPI cards, ensuring that the previous period adjusts based on the user’s current selection without manual recalibration.

Below is the link of the dataset:
SalesData.xlsx

Thank you!

Hello @Purushothaman

I would recommend checking out this topic with a similar need:

There is an arena link with an example of how to make this work.

1 Like

Hi @duncan
Thank you for sharing a work around. But the workaround is complex and just for one Visualisation, the rest other visualisations are to adjusted.

What I see this is a very basic feature to have any BI tool, I don’t know how Quicksight missed it to have.