Label Only on Highlight

Did you know you can only show labels when a circle is highlighted in a scatterplot? Hiding labels makes your dashboard appear visually clean and removes the label clutter that can occur with multiple metrics in close range.


In the example below, all three worksheets display the data for the state of Ohio only when the mouse is hovering over this circle in one of the charts. Each chart is in sync, so you can see how Ohio performed in Sales, Profits and view the Profit Ratio.


This example is modified from this dashboard by Justin Davis. I refer beginner users to this dashboard specifically to show what they are capable of in Tableau. It's a beautiful dashboard that displays quite a variety of charts.


You will need to create the following calculated fields to create just the Sales view for this dashboard;


Current Month

[Order Date] >= DATEADD("month",-1,DATETRUNC("month",{MAX([Order Date])}))

AND

[Order Date] < DATETRUNC("month",{MAX([Order Date])})


Last Month

[Order Date] >= DATEADD("month",-2,DATETRUNC("month",{MAX([Order Date])}))

AND

[Order Date] < DATEADD("month",-1,{MAX([Order Date])})


Sales CM

If [Current Month]

THEN [Sales]

END


Sales LM

If [Last Month]

THEN [Sales]

END


Sales Up

IF SUM([Sales CM])> SUM([Sales LM]) then '▲'

ELSE ''

END


Sales Down

IF SUM([Sales CM])< SUM([Sales LM]) then '▼'

ELSE ''

END


The worksheet is created as below;


Place Sales CM on the Columns shelf.

Put the following on the Label card:

  • State

  • Sales CM

  • Sales Up

  • Sales Down

Additionally put State on the Detail card.

Change the Mark type to Circle.

Right-click on Rows and add the Index() calculation. Right-click on this calculation and select compute using State.

Remove your grid lines.

Select Fit Width in the Tool menu.

Right-click on the Axis to remove the Title. Go to the Tick Marks tab and make it Fixed with 5,000 intervals.



Click on the ellipsis in the Label drop-down menu to open the Edit Label pop-up menu. I formatted the text as shown below. I made Sales Down red and Sales Up in blue.

Ensure Highlighted is selected under Marks to Label.


I also hid the Null indicator for this graph.

I hid the Index() header for this view by right-clicking and deselecting the Show Header option.

I made the default Pane shading for this dashboard to light gray. You can refer to last week's tip on Column banding for this step.

I changed the circle color to a darker gray.

I proceeded to replicate this view on new worksheets for Profit and Profit Ratio.

I added all three worksheets to a dashboard.

I clicked on Dashboard > Actions and then clicked Add Action > Highlight.

I set up the Highlighted Action as shown below;



Then I clicked OK. You can download Justin's dashboard to see his calculation or you can download mine here.

166 views0 comments