Month to Date vs Last Year's Month To Date Comparison

Hey folks,

I’m trying to put together a period over period comparison where I would like to compare the count of a field to date for this month (eg. count of sales to date for May) versus the count of sales to date in May of last year.

So far I’ve got this calculated field defined:

periodOverPeriodDifference(count({sales_id}), {sales_date}, MONTH, 12)

but when I plop it into a table it shows me what looks like this month vs this month last year differences that are for the whole month and not “to date”. That is, I want to compare sales from May 1st, 2022 to May 22, 2022 to sales from May 1st, 2023 to May 22, 2023. Furthermore, if I put a filter on the sales_date field to start after May 1, 2023, the comparison ceases to work because of what looks like an inability to grab data from before May 1, 2023.

How would I go about achieving a “this month to date vs this month to date last year” comparison?


Hi @joeyu629

For this you should be able to leverage the period to date sum.

Documentation and community post to guide you through.

let me know if this does the trick.

Ramon Lopez

1 Like

Did Ramons suggestion work for you? I’ll mark it as a solution. Please let us know if you have any further questions.

Thank you.

1 Like

I couldn’t get it to work but I did find this post the other day that lets me accomplish what I was trying to do:

1 Like

Thank you @joeyu629 for sharing the solution that you found with the QuickSight Community! :slight_smile: