top of page

Tableau charts: Slope chart

Slope chart in Tableau

Definition

Slope chart is used to show developments between two points. e.g., between two dates or fields.

Slope chart best practices

  • Always label the fields clearly.

  • Provide additional details on the tooltip.

Example of a slope chart

example of slope chart in tableau

Therefore, this article will help you learn how to build a slope chart in Tableau using table calculation Rank. Using data on ‘Main roofing type’ in Kenya, I’ll demonstrate how to compare use of ‘Corrugated Iron Sheet’ and ‘Asbestos Sheets’ for different Counties within the country. Our goal is to rank Counties in order of using a particular roof type.

Connect data set above to Tableau app and follow along to learn more.

Step 1: Compute rank of ‘Asbestos Sheets’

Create the table calculation below,

tableau rank function

Under ‘Default Table Calculation’ compute using ‘County’.

computing rank using the dimension county

Step 2: Compute rank of ‘Corrugated Iron Sheets’

Repeated Step 1 above but now using measure field ‘Corrugated Iron Sheets’.

Tableau rank function

Step 3: Let’s build our chart

  • Drag the calculated field ‘Rank -Asbestos’ to the rows shelf.

  • Notice the field is highlight in red, this is because our rank field is computed along the ‘County’, to correct this, introduce the field ‘County’ to the details shelf. (Since, my field is a hierarchy, I will drag ‘Province’ out of the details shelf to remain with County only).

  • Drag calculated field ‘Rank -Corrugated Iron Sheets’ to the axis as show below.

Resulting view.

  • Chose Line under marks card.

  • Right click on the axis>>Edit Axis… and reverse the axis.

reversing axis in tableau

Resulting view.

Step 4: Let’s do some formatting

  • Drag dimension field ‘County’ to the Label shelf.

  • Drag the measure field ‘Measure Values’ to the label shelf.

  • Select ‘Label’ shelf to open, edit as shown below.

editing and formatting labels in tableau

Drag ‘Measure Values’ to the color shelf and remove lines.

Tableau slope chart final

From this view, comparison on use of Corrugated Iron Sheets and Asbestos sheets can be done with lots of ease. For instance, Nairobi county is ranked both No. 1 in use of the roof types, while Narok county is ranked No. 13 and No. 31 in use of Asbestos sheets and Corrugated Iron Sheets respectively. More insights can be draw without much strain.

I hope this article was helpful to you. To receive more of the Tableau tips kindly join our mailing list by subscribing below.

Thank you for reading.

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page