Can I have the sum of sales for selected year (by user) from the date filter and sum of sales for its previous year as well in bar chart?

I need to use a date filter from where the user will select particular date. Once the date got selected, the bar chart should dynamically show the sum(sales) for selected year and its previous year.

If I select this filter ,
image

The Bar chart should show like this,
image

The bar chart should show 2023 (selected) and 2022 (its previous year) in X-axis and sum(sales) in Y-axis.

I tried creating parameters for filtering date and period over period difference calculation for measure. But I couldn’t find what’s the exact mistake I’m doing.
Please give a clear solution for this… Thanks in advance.

Hi,

I believe this blog is what you’re looking for.

I would suggest using this - periodOverPeriodLastValue function to implement this use case

Detailed example is also provided here for given requirements - https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Calculation-Year-over-Year-Table-with-Filtering-aka-Date-Hider-

1 Like

Thank you for the links and demo central. It was helpful.
But, I don’t need this date hider. Instead, I would like to have one common date filter for all the visuals in the dashboard which should work on this bar chart as well…

If I add date hider, Its not working on the charts which has no order_date column in it.
I want the filter to be common for all the visuals in the dashboard.
Is it possible ?