How to Calculate Equivalent Comparison Dates in Tableau
Автор: OneNumber - Tableau Experts
Загружено: 2025-05-21
Просмотров: 1256
Do you need to use Tableau to compare values to an equivalent date from a prior year? For example, "How did sales from this Monday compare to the same Monday from last year?"
This is different than comparing to the exact same date from last year since the comparison is probably 364 days (52 weeks) ago. Additionally, this can be made complicated if there are any gaps in your data. For example, if your business doesn't record transactions on Saturdays, you can't simply use the LOOKUP function to go back 364 days because that would take you back too far. Additionally, if you apply a filter and "lose" days in your data set as a result, the LOOKUP approach will fail.
Check out this video and workbook for a full breakdown of how you can use the DATEDIFF function to ensure you're always comparing values across equivalent dates regardless of what data might be missing in your data set or worksheet.
Connect with us:
•Book an Office Hour with Eric: https://www.eventbrite.com/e/tableau-...
•Tableau Passport Program: https://onenumber.biz/tableau-trainin...
•Upcoming Tableau Classes: https://www.eventbrite.com/o/onenumbe...
•Subscribe to the OneNumber Newsletter: https://onenumber.biz/newsletter
•Follow Eric on LinkedIn: / eric-parker-37513249
Resources:
•Tableau Public Workbook: https://public.tableau.com/app/profil...
•Calculations in blog post here: https://onenumber.biz/blog-1/2025/05/...
•Level of Detail to Find MAX Date: https://onenumber.biz/blog-1/2023/1/2...
Chapters:
0:00 Background
1:30 LOOKUP Version
3:50 Build Comments
5:03 DATEDIFF Solution
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: