Master Tableau From Scratch

Learn Tableau fundamentals, data connections, data preparation, filtering, data modeling, calculations, LOD expressions, visualizations, dashboards, and storytelling through structured practical lessons.

COURSE SYLLABUS

Sorting Data in Tableau

Learn how to organize dimensions and measures using ascending, descending, alphabetical, manual and field-based sorting. Understand different sorting methods and create meaningful, easy-to-read visualizations using Tableau.

1. Introduction to Sorting Data in Tableau

Sorting is an important data analysis feature in Tableau. It helps users arrange data in a meaningful order so that important information can be identified quickly. When a dataset contains many categories, products, regions or sales values, sorting makes the visualization easier to understand.

For example, a sales report may contain several product categories. By sorting the categories based on sales, an analyst can immediately identify the highest-selling and lowest-selling categories.

Why is Sorting Important?

  • Identifies the highest and lowest performing categories.
  • Organizes data alphabetically or numerically.
  • Makes charts and tables easier to read.
  • Helps compare business performance.
  • Highlights important trends and patterns.
  • Improves the presentation of analytical reports.
Unsorted Data Sorted Data East - 25,000 West - 60,000 North - 40,000 South - 85,000 Sort South - 85,000 West - 60,000 North - 40,000 East - 25,000
Sorting transforms an unordered dataset into an organized view based on a selected field.

2. Types of Sorting in Tableau

Tableau provides multiple ways to sort data depending on the analytical requirement. Users can sort data using toolbar controls, field-specific options or manual arrangement.

1. Ascending Sort

Ascending sorting arranges values from the smallest to the largest or alphabetically from A to Z.

For example, numerical values such as 10, 20, 30 are arranged in increasing order. Category names such as Apple, Banana and Mango are arranged alphabetically.

2. Descending Sort

Descending sorting arranges values from the largest to the smallest or alphabetically from Z to A.

For example, sales values of 90,000, 60,000 and 30,000 can be displayed from highest to lowest.

3. Alphabetical Sorting

Alphabetical sorting arranges dimension members according to their names. It is useful when working with product names, customer names, regions and category labels.

4. Manual Sorting

Manual sorting allows users to arrange dimension members in a custom order. Instead of following alphabetical or numerical order, users can place categories according to a specific business requirement.

5. Field-Based Sorting

Field-based sorting arranges dimension members according to the values of another field, such as Sales, Profit, Quantity or another measure.

Sorting Type Order Example Typical Use
Ascending Small to large 10, 20, 30 Lowest to highest values
Descending Large to small 90, 60, 30 Highest to lowest values
Alphabetical A to Z Apple, Banana, Mango Organizing categories
Manual Custom order Priority-based order Business-specific presentation
Field-Based Based on another field Region by Sales Performance comparison

3. Sorting Data Using Toolbar Icons

One of the quickest ways to sort data in Tableau is through the sort toolbar controls. These controls allow users to sort displayed data without opening a detailed sorting dialog.

When a dimension or relevant field is selected in a worksheet, users can apply ascending or descending sorting using the available toolbar options.

Ascending Descending Worksheet Sorting Controls Tableau Toolbar - Conceptual Illustration
Conceptual illustration of ascending and descending sort controls.

Steps to Sort Using Toolbar

  1. Open Tableau Desktop and connect to a dataset.
  2. Create a worksheet.
  3. Drag a dimension such as Region or Category into the view.
  4. Add a measure such as Sales to the visualization.
  5. Select the relevant dimension or mark in the view.
  6. Use the ascending or descending sort toolbar control.
  7. Observe the updated order of the displayed members.
Tip: Toolbar sorting is useful for quick sorting operations. For more control over the sort field, aggregation and order, use the field's Sort dialog.

4. Sorting Using the Sort Dialog

Tableau provides a Sort dialog for configuring more detailed sorting options. Users can specify the sort order, sort type and the field used to determine the order of dimension members.

This method is particularly useful when a dimension needs to be sorted according to a different measure. For example, a list of regions can be arranged using total Sales instead of region names.

Available Sort Settings

Setting Description
Sort Order Choose ascending or descending order.
Sort By Data Source Order Uses the order supplied by the underlying data source where supported.
Sort By Alphabetic Arranges members according to their names.
Sort By Field Uses another field and its aggregation to determine the order.
Sort By Manual Allows members to be arranged in a custom order.

Steps to Use the Sort Dialog

  1. Open a worksheet containing a dimension.
  2. Locate the dimension in the Data pane or view.
  3. Right-click the dimension and select Sort.
  4. Choose the required sort order.
  5. Select the sorting method.
  6. If sorting by a field, select the field and aggregation.
  7. Apply the settings and review the updated visualization.
Sort Sort Order Descending Sort By Field Field Sales SUM
Conceptual representation of the Tableau Sort dialog. Exact controls may vary by Tableau version and field type.
Important: The available sorting options can vary depending on the field type, data source and the current worksheet view. Always verify the selected aggregation before applying a field-based sort.

5. Sorting by a Measure or Another Field

Sorting by a field is one of the most useful sorting techniques in Tableau. It allows users to arrange dimension members according to the values of another field.

For example, a sales dashboard may display different regions. Instead of arranging region names alphabetically, the analyst can sort them based on total sales.

Region Performance by Sales South 85,000 West 60,000 North 40,000 East 25,000 Sorted by SUM(Sales) - Descending
Regions are arranged from the highest sales value to the lowest sales value.

Practical Steps

  1. Drag Region to Rows.
  2. Drag Sales to Columns to create a bar chart.
  3. Right-click the Region field or use its sort options.
  4. Choose Sort By Field.
  5. Select Sales as the sorting field.
  6. Select SUM as the aggregation when appropriate.
  7. Choose Descending order.
  8. Verify that the highest-sales region appears first.
Business Example: A regional sales manager can use field-based sorting to identify the best-performing region without manually comparing every sales value.

6. Manual Sorting in Tableau

Manual sorting is useful when the default alphabetical or numerical order does not match the required business presentation. Tableau allows users to arrange members in a custom sequence in supported views.

For example, a company may want to display its sales regions in a specific operational order rather than alphabetically.

Example: Custom Region Order

Default Order Custom Business Order
East West
North South
South East
West North

Steps for Manual Sorting

  1. Create a visualization containing the required dimension.
  2. Display the dimension members in the worksheet.
  3. Use the manual sort option when available.
  4. Drag the members into the desired order, or use the available manual ordering controls.
  5. Review the updated visualization.
Note: Manual sorting behavior depends on the visualization and the field configuration. In some situations, a dedicated sort dialog or a separate ordering field may be more appropriate.

7. Sorting Dimensions and Measures

Dimensions and measures play different roles in Tableau. Dimensions represent categorical or descriptive values, while measures represent quantitative values. Sorting can be applied to both depending on the visualization and analysis requirement.

Field Type Example Sorting Requirement
Dimension Product Category Alphabetical or custom category order
Dimension Region Arrange regions by Sales
Measure Sales Highest to lowest sales values
Measure Profit Lowest to highest or highest to lowest profit
Date Order Date Oldest to newest or newest to oldest
Best Practice: Choose the sorting field based on the question your visualization needs to answer. For a performance dashboard, sorting categories by a relevant measure is often more useful than sorting them alphabetically.

8. Practical Example: Sort Product Categories by Sales

In this practical example, we will create a bar chart showing product category sales and arrange the categories from highest to lowest sales.

Sample Dataset

Product Category Sales
Furniture 75,000
Office Supplies 45,000
Technology 95,000

Implementation Steps in Tableau

  1. Open Tableau Desktop.
  2. Connect to the sample dataset.
  3. Open a new worksheet.
  4. Drag Product Category to the Rows shelf.
  5. Drag Sales to the Columns shelf.
  6. Ensure that Sales is aggregated as SUM(Sales).
  7. Choose descending sorting based on SUM(Sales).
  8. Check the resulting category order.
Product Category Sales Technology 95,000 Furniture 75,000 Office Supplies 45,000 Sales - Descending Order
Product categories arranged according to total sales.
Expected Result: Technology appears first because it has the highest sales value. Office Supplies appears last because it has the lowest sales value in this example.

9. Common Sorting Problems and Solutions

Sometimes sorting may not produce the expected result. Understanding common issues helps users troubleshoot their worksheets effectively.

Problem Possible Reason Solution
Incorrect numerical order Values may be stored as text. Check the field data type and correct it when necessary.
Unexpected category order A different sort field may be selected. Review the Sort dialog settings.
Repeated or tied values Multiple members have the same measure value. Review aggregation and consider a secondary ordering field.
Manual order not maintained The view or field configuration may affect manual sorting. Check the sort configuration or use a dedicated ordering field.
Date order appears incorrect The date field may be treated as text or a different date level. Verify the date data type and selected date level.

10. Best Practices for Sorting in Tableau

  • Choose ascending or descending order according to the analytical objective.
  • Use measure-based sorting when comparing business performance.
  • Use alphabetical sorting when users need to locate categories quickly.
  • Use manual sorting only when a custom presentation order is required.
  • Verify the aggregation used in field-based sorting.
  • Check data types when numerical or date sorting looks incorrect.
  • Keep chart ordering consistent across related dashboard views.
  • Test the final visualization after changing sort settings.

Summary

Sorting in Tableau helps users organize dimension members and measure values into meaningful sequences. It improves data readability and makes it easier to identify important categories, performance differences and business trends.

Tableau supports ascending, descending, alphabetical, manual and field-based sorting. Users can apply quick sorting through toolbar controls or configure detailed sorting options through the Sort dialog.

By practicing these techniques with real datasets, users can create more organized worksheets and professional analytical dashboards.