2021 Week 20 | Tableau: Can you compare Same Day to a Selected Date?

Introduction

I came across an interesting challenge. When comparing data, Tableau automatically compares to the same date on the prior month/year etc. But what if you want to compare to the same DAY. For example, Tuesday 18th May 2021, would compare to Tuesday 19th May 2020 for the previous year, and Tuesday 20th April for the previous month. The reason you would want to do this is to compare the Tuesday to Tuesday.

This challenge also builds off of Andy’s DS Gym from last week, using Table Calculations.

Requirements

  • Dashboard Size: 500px by 600 px
  • # of Sheets – 2
  • Create BAN which compares the percent difference between the selected date and either Same Day Last Year, Same Day Last Month or Last Week
  • You need to get the following values:
    • Selected Date Sales
    • Selected Comparison Sales
    • Percentage Difference
    • Selected Comparison Date
  • Create a line chart by day, showing the selected and comparison value as line ends.
  • Create an action to allow you to change the selected date via the line chart and a reset button back to 18/05/2021.
  • NO LOD’S – TABLE CALCS ONLY!
Theres a Hint in the Watch section.

Dataset

This week uses the superstore dataset for Tableau 2021.1. You can get it here at data.world

Attribute

When you publish your solution on Tableau Public make sure to take the time and include a link to the original inspiration.  Also include the hashtag #WOW2021 in your description to make it searchable!

Share

After you finish your workout, share on Twitter using the hashtag #WOW2021 and tag @AnnUJackson, @ItsCandraM, @LukeStanke, @_Lorna_Brown and @HipsterVizNinja

Solution

HINT: Take a read of this blog

Interactive

1 thought on “2021 Week 20 | Tableau: Can you compare Same Day to a Selected Date?”

  1. Hi Lorna,
    Little issue in the Viz, whenever the last month same day is 5 weeks away the viz show wrong information for ex if you select the day as 31 oct 2020 (Saturday) then same day last month should be 26th September 2020(Saturday) but the viz shows 3rd October 2020 so to calculate the same day last month you are just deducting 4 weeks but it can be 5 weeks as well.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top