If you would have happened to read my earlier Blogs you would have noticed that I have kept saying that Tableau is all about visualizations and that too visualizations that will make you stand apart. That means, you add little enhancers in your visualization that will make it appear different from a normally created viz; along with that it should satisfy your 80 : 20 relation(that means, in first 20 sec at the look of your viz you should come to know 80% of what your analysis is.).
So, on this ground, let’s make another viz that we will prove that we have an expertise in Tableau and we can actual make a viz that would be little different from others.
This time let’s change our dataset so that you can practice all the various examples that I have shared with you earlier on this data set also and gain some extra hands on experience. So, for this example we will use Sample Superstore Sales (excel) and in case you do not have the data set you can download it from the below link:
https://community.tableau.com/docs/DOC-1236
Step- 1: Open Tableau and connect it to Sample Superstore Sales (excel).
Tableau will ask you to use a Data interpreter, but you can skip using it. Drag Orders table to the Data source preview space.
Step-2: Drag Order Date (Dimension) and Customer Segment (Dimension) to the Worksheet.
Step- 3: Make two Calculated Field:
- Latest Year with the formula:
IF {MAX(YEAR([Order Date]))} = YEAR([Order Date])
THEN [Sales] ELSE 0 END
- Prior Year with the formula:
IF {MAX(YEAR([Order Date]))} – 1 = YEAR([Order Date])
THEN [Sales] ELSE 0 END
Bring these two Calculated field to the Viz and using your Show me button make a proper Text Table like the below:
Step- 4: Prepare a Bar Chart with Customer Segment in Rows and Latest Year in the Columns of the worksheet.
Step- 5: Put Prior Year Calculated field in Detail Shelf in the Worksheet and from the Analytics Pane add a reference line of Prior Year on per Cell.
Step-6: Now we want to put the KPI next to the bars. For this we make 2 Calculated fields:
- YoY Growth with the formula:
SUM([Latest Year]) >= SUM([Prior Year ])
- Mark Position with the formula:
AVG(-50000)
Step- 7: Put Mark Position to Column & Dual Axis n synchronize axis.
Go to Latest Year marks card and switch it to bar. Then go to Mark Position and bring out Shape. Add YoY growth to shape & put desired shape.