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:
- 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.
- 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!