How to Sort in Tableau
Arranging your data in the right order is one of the quickest ways to bring clarity to a visualization. Tableau offers several ways to sort your data, from simple one-click operations to more advanced custom arrangements. This tutorial will walk you through the different sorting methods available in Tableau so you can organize your views and make your dashboards more insightful.
The Easiest Method: One-Click Sorting
The fastest way to sort your data in Tableau is by using the single-click sort icons that appear when you hover over axes or headers. This is perfect for quick, on-the-fly analysis directly within your visualization.
Sorting on an Axis
When you have a chart with a quantitative axis (like a bar chart showing sales), hovering over that axis reveals a small sorting icon. Clicking this icon instantly reorders the corresponding dimension bars.
- For a horizontal bar chart: Hover over the Y-axis label (the names of your categories). A sort icon will appear. Clicking it will sort the bars and labels in ascending or descending order based on the measure value.
- For a vertical bar chart: Hover over the X-axis header (the dimension members along the bottom). A sort icon will appear next to the header name. Clicking will reorder the bars.
For example, if you have a bar chart showing Sales by Sub-Category, clicking the sort icon on the Sales axis will instantly arrange your sub-categories from highest-selling to lowest-selling, or vice versa with another click.
Sorting on a Header in a Table
If you're working with a text table or a datasheet, you can use a similar method. Hover over a field's header, and a sort icon will appear. Clicking it sorts the entire table based on the values in that column. This is incredibly useful for instantly ranking items in a large list.
Sorting from the Toolbar
Another simple way to apply a basic sort is by using the sort buttons in the Tableau toolbar at the top of the window. You'll see two buttons with bars of increasing and decreasing size, representing ascending and descending sorts.
To use this method:
- Click on the specific measure or header you want to sort by in your view. This makes it the "active" field. For instance, in a view with
SalesandProfit, click theSalesheader to focus on it. - Click the ascending or descending sort button in the toolbar.
This method sorts all dimensions in the view based on the selected measure. For example, if you have Region and State in your rows, sorting by SUM(Sales) will order the regions, and within each region, the states, by their sales performance.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
For Full Control: The Sort Dialog Box
For more detailed control over your sorting logic, you need to use the Sort dialog box. This is where you can define specific rules that aren't available through a single click. To access it, right-click (or control-click on Mac) the dimension pill in the view that you want to sort and select "Sort..."
This opens a window with several advanced options.
Sort By Data Source Order
This is the default sort order. It sorts your dimension based on how the data is stored in the original data source. For most text-based fields, this ends up being an alphabetical sort, but for numerical or specific data types, the order might differ.
Sort By Alphabetical Order
As the name suggests, this option sorts the members of your dimension alphabetically. You can choose A-Z (Ascending) or Z-A (Descending). This is useful when you want to organize item names, customer names, or geographical locations in a universally understood order.
Sort By Field
This is one of the most powerful and common sorting methods. It allows you to sort a dimension based on the value of another field, typically a measure.
For example, you could sort the Customer Name dimension based on the SUM(Sales). This shows you which customers are most valuable.
When you choose "Field," you'll get two more options:
- Sort Order: Choose Ascending or Descending.
- Field Name: A dropdown list of all available fields in your data source. You select the measure you want to use for the sort.
- Aggregation: Select how the measure should be aggregated (Sum, Average, Count, etc.). By default, it uses the aggregation that's already in the view, but you can change it here.
Sort By Manual Order
Sometimes, your data needs to be sorted in a way that has no relation to its name or value. For instance, you might want to order survey responses from "Very Dissatisfied" to "Very Satisfied" or arrange sales regions in a specific non-alphabetical sequence (East, West, North, South).
The manual sort option lets you drag and drop the dimension members into whatever order you need. Simply click on a member and move it up or down the list until it's in the correct position.
Sort by Nested
Nested sorting is used when you have multiple dimensions in the rows or columns. It sorts the "inner" dimension independently within each pane of the "outer" dimension.
Imagine a view showing Sales by Category and Sub-Category. A non-nested sort would try to order all sub-categories globally by Sales, which can jumble the visualization. A nested sort, however, ranks the sub-categories within each category. So, the highest-selling sub-category in "Technology" appears first under Technology, and the highest-selling sub-category in "Office Supplies" appears first under Office Supplies.
You access this by selecting "Nested" from the "Sort by" dropdown in the Sort dialog box.
Advanced Sorting with Calculated Fields
What if you want to sort by a logic that doesn't exist in your data? This is where calculated fields come in. By creating a new field, you can define a custom sort order and apply it to your dimensions. This technique is especially useful for handling things like custom time periods or specific categorical rankings.
Let's say you want to sort the months of the year in chronological order (January, February, March...) instead of alphabetical order (April, August, December...).
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Step 1: Create the Calculated Field
Create a calculated field called Month Sort with a formula like this:
`` CASE [Month Name] WHEN "January" THEN 1 WHEN "February" THEN 2 WHEN "March" THEN 3 WHEN "April" THEN 4 WHEN "May" THEN 5 WHEN "June" THEN 6 WHEN "July" THEN 7 WHEN "August" THEN 8 WHEN "September" THEN 9 WHEN "October" THEN 10 WHEN "November" THEN 11 WHEN "December" THEN 12 END
This formula assigns a numerical value to each month, creating the logical order we need.
### Step 2: Apply the Calculated Field
1. Drag your original `Month Name` dimension to the Rows shelf.
2. Drag your newly created `Month Sort` calculation to the Rows shelf and place it *to the left* of `Month Name`.
3. Right-click the `Month Sort` pill and make sure it's set to "Discrete."
4. Now your table is sorted chronologically! To clean up the view, right-click the `Month Sort` pill again and uncheck "Show Header."
The numbers from your `Month Sort` calculation will disappear, but the sort order remains. You can use this same technique to create custom product rankings, tiered customer segments, or any other manual sort order based on complex business logic.
## Final Thoughts
Knowing how to effectively sort your data in Tableau is essential for creating compelling reports that are easy to understand. By mastering the one-click methods, toolbar buttons, detailed Sort dialog box, and advanced calculated field techniques, you can arrange your visualizations to highlight the most important insights and guide your audience through the data's story.
Learning how to perform these steps in powerful BI tools is one part of the battle, but manually building reports and wrangling data from multiple sources is often the bigger time-sink. At [Graphed](https://www.graphed.com/register), we've created an AI data analyst that streamlines this whole process. By connecting your sources like Google Analytics, Shopify, and HubSpot, you can simply ask for the chart you need in plain English - "show me sales from the last quarter sorted by customer" - and get a live-updating, perfectly sorted chart in seconds, without ever opening a sort dialog box.Related Articles
Facebook Ads for Landscapers: The Complete 2026 Strategy Guide
Learn how to run profitable Facebook ads for landscapers in 2026. This complete guide covers audience targeting, ad formats, budgeting, and optimization strategies to generate leads at $30-50 per lead.
Facebook Ads for Painters: The Complete 2026 Strategy Guide
Learn how to run profitable Facebook ads for painters in 2026. This complete guide covers audience targeting, ad formats, budgeting, and optimization strategies to generate leads at $20-60 per lead.
Facebook Ads for Chiropractors: The Complete 2026 Strategy Guide
Discover how chiropractic practices can leverage Facebook advertising to attract new patients in 2026. Learn the top strategies, compliance requirements, and proven ad templates that drive appointments.