Calculate Year to Date vs Previous Year to Date in Tableau

preview_player
Показать описание
When calculating growth rates from one date period to another, it’s important to compare apples to apples. For instance, when building a graph in Tableau to compare quarterly sunscreen sales in Seattle, I probably wouldn’t want to compare Q3 Sales (July - September) to Q2 Sales (April - June) because there will be more sales in Q3. The product has a cyclical sales cycle. Instead, I would rather compare Q3 Sales of this year to Q3 Sales of last year to more accurately understand growth rates.

Connect with us!
Рекомендации по теме
Комментарии
Автор

Nice tutorial! Thanks and thank you for smiling while you made it.

oliviadowney
Автор

hi ! Thankyou, just a Query :

What if we have data for 2022 till February and compare it to 2021 same period, In that case applying today( ) (as 21-May-2022) in the PYTD Field wont work correctly then, Can you suggest something then ?

VARISHROCKS
Автор

Hey there - love this video. Isit possible to calculate prior year % growth depending on the date you have selected in a filter? So for example if I have the dates 1st Feb 2020 to 6th June 2020 I want to compare that to the same period in 2019? Many thanks

JD_
Автор

how to calculate same period last year sales e.g the year start from 1/4/2022 to till date, but i want same data previous year means 1/4/2021 to 7/2/2022

yogitashelar
Автор

I have one scenario
I want to showcase last 12 months from last Max date till previous 12 months of Sales; where each month sales is running sum of previous 12 months.
For example: sales of April24 is runningsum of sales from May23 to April 24; similarly May23 sales is runningsum of sales from June22 to May23. How to achieve that?

arijitbanerjee
Автор

Thanks for this, Erik!! What would you suggest as a PY calculation if I was looking to apply this to last 6 months sales vs. prior period last 6 months sales?

caitlynhollowell
Автор

Thanks, Erik. I'm getting to know little by little this fabulous visualization tool!! Still have a hard time understanding how to create calculated fields, as they don't seem very intuitive to me. Perhaps you could make a video about tips on how to create Calculated Fields? That would be awesome! I just subscribed to the channel so I can browse videos already made by you and be aware of new ones. Thanks again!

MissFSimoes
Автор

Great video, thanks. Is there a way to dynamically control all these four measures. For example; if a user would like to have a drop down month filter and based on the month selection the four fields gets calculated. Thanks in advance.

kumaramitesh
Автор

Great Video!! so happy I found this! You are a natural teacher

divinestar
Автор

Thanks so much for this tutorial, this has been great. I have one question though - could i adapt these calculations to show up until the last day of the last month for both current and previous year? ie comparing a measure for 2023 vs 2024 by month and i would like to see as at end of April for both years what the YTD total was? thanks again, love your channel!

jjgaming
Автор

Hello, I would like to ask. So, I need to calculate cumulative sum for previous date but the previous date doesn't based on today but the date I filtered.

This is the formula from SpotiFlyer:
Sum([total_amount_rech]) OVER (AllPrevious([trx_date])) /
UniqueCount([trx_date]) OVER (AllPrevious([trx_date]))

I need to remake that on Tableau. Can you help me to understand the formula in Tableau? Thank you very much in advance.

andrea
Автор

Hi Erik, Loved your video. But i am performing the YTD calculations of aggregated measures.I am getting the error of mix of agg/non aggr in the formula. Can you suggest me on how to do it?

anudeepdb