Top 12 Months Sales with Previous Year Sales in Table Visual

I want to show the Total Sales and Previous Year Sales for particular Month for most recent 12 Months.

What I am able to achieve :

  1. Able to show total sales and previous year sales for particular month for the months in the dataset.(screenshot attached)

Unable to achieve and wanted to have a solution from community:

  1. Showing the total sales and previous sales for most recent 12 months.
    I tried creating filters for recent 12 months, but it is not showing Previous Year sales. (April 2022, PY sales is Blank and so on) Screenshot attached below

you may use “Date hider” and “periodOverPeriodLastValue” to build this. Below is the screenshot that I have created
image

step 1: create calculated field Same month last year: periodOverPeriodLastValue(sum(Sales),{Order Date},MONTH,12)
I think you should have built this already

step2: create calculated filed DateHider: minOver(min(Date), [Date]) and use it as filter

step3: go to filter and set the default value to be last 12 months
image

you may also refer to the demo here https://democentral.learnquicksight.online/#Analysis-TipsAndTricks-Calculation-Year-over-Year-Table-with-Filtering-aka-Date-Hider-

1 Like

Thanks @royyung . This is pretty cool trick.
It has not completely solved my issue. I have to show the result for 12 months (which is from April 2022 - March 2023).
But it showing the data from Dec 2021 to Nov 2022 which totals to 12 months .

The result of the solution provided.

The result i want.
image

do you want to always showing this fiscal year Apr to Mar?
if today is apr1 2023, should it shows Apr2023 to Mar 2024?

1 Like

Yes, I want to show this from April to Mar