Last Modified Date: 09 Feb 2018
Environment
Tableau DesktopAnswer
In this example, we will create a 4 steps color legend, associated to a map of Sales by State using the Superstore data source.Build the view:
- Connect to Superstore
- Drag State to details and Sales on colors
- Edit the color legend to choose 4 steps
Build the legend:
Create the following calculated fields:
- Tick 0 :
MIN({INCLUDE [State]: SUM([Sales])})
- Tick 1 :
MAX({INCLUDE [State]: SUM([Sales])})*0.25
- Tick 2 :
MAX({INCLUDE [State]: SUM([Sales])})*0.5
- Tick 3 :
MAX({INCLUDE [State]: SUM([Sales])})*0.75
- Tick 4 :
MAX({INCLUDE [State]: SUM([Sales])})
- Drag 4 copies of MIN([Number of Records]) to Columns (one for each step)
- Select Bar chart as chart type and increase the size to the maximum
- Edit each axis to a fixed range from 0 to 1
- On the first copy of MIN([Number of Records]), drag Tick 1 to Text. Repeat to have one tick per mark.
- Create a field MIN(0) on columns, just after MIN([Number of Records]) and select Dual Axis and Synchronize Axis
- On the MIN(0) mark, drag Tick 0 to Text
- Right click on the first copy of MIN([Number of Records]) and uncheck 'Show Header'
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials