May 10, 2017

Highlight the first element in a bar chart using Tableau

Top N bar charts are quite common in Tableau. I have used this technique to jazz up a few of my latest vizzes for my clients. Often bar charts do not use color as each bar already represents a unique dimension. When creating Top N charts with the Tableau table calc Index(), you can highlight the top bar using a different color to help the user recognize the top element.

Follow these steps to recreate this view.



  1. Connect to the Superstore data source.
  2. Add Region and State to Rows
  3. Add Sales to Columns
  4. Apply a descending sort on State using Sum([Sales])
  5. Add an Index() function on the rows as an in-place pill
  6. Adjust the Compute Using to State
  7. Drag copy Index() to Colors and Filter
  8. Adjust filter to range of values, I used 1 to 5.
  9. Now change the pill to Discrete
  10. click Color and change the color of the first element to your color choice
  11. Change elements 2 thru n to grey or some other neutral color.
    Thanks for reading and feel free to reach out if you have any questions.

    Twitter: scott_strool
    Web: Vizardry.com (under Construction)

No comments:

Post a Comment