Tableau Lesson 9 – Sorting & Grouping | Dataplexa
Section I — Lesson 9

Sorting and Grouping

Sorting makes patterns visible — the highest value jumps to the front. Filtering removes the noise so your audience sees only what matters. Grouping lets you combine individual members into named buckets so you can analyse them together. These three tools are the backbone of shaping any Tableau view.

Sorting in Tableau

Tableau offers three ways to sort a view. Each method gives you a different level of control, from a single click to a fully customised order.

One-Click Sort — Toolbar Button

The fastest option. Click the Sort Ascending or Sort Descending button in the toolbar (the two horizontal-bar icons). Tableau immediately reorders the view by the active measure. One more click reverses the order. A third click removes the sort entirely.

Axis Sort — Click the Axis Header

Hover over the column or row axis header in the view until a small sort icon appears. Clicking it cycles through ascending, descending, and unsorted. This is the most intuitive method for quick exploratory sorting.

Sort Dialog — Full Control

Right-click the Dimension pill on the shelf and select Sort. The Sort dialog lets you sort by data source order, alphabetically, by field value (choose any measure and any aggregation), or by a manual custom order you define yourself.

Sort Dialog — Labelled Mockup

Here is what the Sort dialog looks like when you right-click a Dimension and choose Sort, with the most useful options highlighted:

Sort [Category]
Sort Order
Sort By
Field Name
Sales
Aggregation
Sum
Clear Sort
OK

Filtering in Tableau — Four Filter Types

Tableau has four types of filters, and they apply in a specific order. Understanding each type helps you build filters that do exactly what you intend without surprising side effects.

Filter Type Applies To Order of Execution Typical Use
Extract Filter The data extract (.hyper file) 1st Reduce extract size at source — keeps only the rows you need
Data Source Filter All worksheets using that connection 2nd Apply a permanent restriction workbook-wide, e.g. current year only
Context Filter The current worksheet only 3rd Create a filtered subset that all other worksheet filters operate within
View Filter The current worksheet only 4th What users add via the Filters shelf — the most commonly used type

Adding a View Filter — Step by Step

The View Filter is what you use in day-to-day chart building. Here is how to add one and configure it for a Dimension and a Measure:

Dimension Filter
1
Drag Region from the Data pane onto the Filters shelf.
2
The Filter dialog opens showing all Region values. Tick or untick individual values — e.g. keep East and West only, uncheck Central and South.
3
Click OK. The Filters shelf shows Region as a pill. The chart now shows only the two selected regions.
Measure Filter
1
Drag Sales onto the Filters shelf. Tableau first asks how to aggregate — select Sum and click Next.
2
The range slider appears. Set a minimum value — e.g. 50,000 — to show only categories where total Sales exceed $50K.
3
Click OK. Categories below the threshold disappear from the chart. The Filters shelf shows SUM(Sales) as a green pill.

Filter Dialog — Labelled Mockup

When you drag a Dimension onto the Filters shelf, this is the dialog that opens. The four tabs give you four different ways to specify which values to include:

Filter [Region]
General
Wildcard
Condition
Top
Select from list
All
None
Condition tab: Filter by formula — e.g. SUM(Sales) > 100000
Top tab: Keep only Top N values — e.g. Top 5 Sub-Categories by Sales
Cancel
OK

Showing a Filter as an Interactive Control

By default a filter on the Filters shelf is invisible to dashboard viewers — they cannot interact with it. To make it interactive, right-click the filter pill on the Filters shelf and select Show Filter. A filter control widget appears on the right side of the view. Viewers can then select or deselect values without any Tableau knowledge.

Control Type Best For How to Switch
Single Value List Selecting one value at a time from a short list Click the filter widget dropdown arrow → Single Value (list)
Multiple Values List Selecting several values at once Click the filter widget dropdown arrow → Multiple Values (list)
Dropdown Long lists where a compact control saves space Click the filter widget dropdown arrow → Single Value (dropdown)
Slider Numeric or date range filters Automatically shown for measures and date range filters

The Top N Filter

One of the most useful filter patterns in Tableau is the Top N filter — showing only the top five or ten items by a measure. This is different from sorting: sorting reorders all items, while a Top N filter removes everything outside the top group entirely.

1
Drag Sub-Category onto Columns and Sales onto Rows to build a bar chart of all 17 sub-categories.
2
Drag Sub-Category onto the Filters shelf. In the Filter dialog, click the Top tab.
3
Select By field, set the number to 5, choose Sales as the field, and Sum as the aggregation. Click OK. The chart now shows only the five sub-categories with the highest total Sales.

Grouping in Tableau

Grouping lets you combine individual dimension members into a single named category. When your data has more granularity than you need for a particular analysis — say, 17 product sub-categories but you only care about three broad buckets — grouping collapses them without changing the underlying data source.

A group creates a new dimension field in the Data pane marked with a paperclip icon. That field can be placed on any shelf just like any other dimension — you can sort it, filter it, colour by it, and use it across multiple worksheets in the workbook.

Ad-hoc Group — Select in View

Hold Ctrl (or Cmd on Mac) and click multiple marks or headers in the view to select them. A small group icon appears in the tooltip — click it to merge the selected members into a new group instantly. Tableau names it automatically; you can rename it.

Group Dialog — Full Control

Right-click a dimension in the Data pane and choose Create > Group. The Group dialog lists every member of that field. Select the members you want to combine, click Group, name the new bucket, and click OK. The new grouped field appears below the original in the Data pane.

Create Group — Sub-Category
Field Members
✓ Bookcases
✓ Chairs
✓ Tables
Binders
Paper
Phones
Groups
📎 Furniture
Bookcases, Chairs, Tables
Other (remaining members)
Include Other — ungrouped members collected into an "Other" bucket automatically
Reset
OK

Building a Group — Step by Step

Here is the full workflow for creating a group from the Data pane dialog, using the Superstore dataset's Sub-Category field as the example.

1
In the Data pane, right-click the Sub-Category dimension and choose Create > Group.
2
In the Group dialog, hold Ctrl and select Bookcases, Chairs, and Tables. Click the Group button. Type Furniture as the group name.
3
Repeat for Office Supplies and Technology groups. Check Include Other to catch any unassigned members. Click OK.
4
The new Sub-Category (group) field — marked with a 📎 paperclip — appears in the Data pane. Drag it onto Color or Columns to see your three buckets in the view.
Tool Changes the data shown? Creates a new field? Best used for
Sort No — reorders only No Making rankings and comparisons easier to read
Filter Yes — hides rows from the view No Focusing on a subset — a time range, a region, a category
Group No — combines members into buckets Yes — 📎 new dimension in Data pane Merging granular members into meaningful named categories
📌 Teacher's Note

Groups are stored in the workbook, not in the data source — so they are always safe to experiment with. If a group no longer makes sense, right-click the grouped field in the Data pane and choose Edit Group to revise it, or Delete to remove it entirely. Nothing in your original data changes.

Practice Questions

1. Which tab in the Tableau Filter dialog lets you keep only the top five Sub-Categories by Sales?

2. What option do you select after right-clicking a filter pill to make it visible as an interactive control for dashboard viewers?

3. You have 17 Sub-Categories and want to combine them into three named buckets — Furniture, Office Supplies, and Technology — without changing the data source. Which Tableau feature do you use?

Quiz

1. How is a Top N filter different from sorting in Tableau?


2. Which Tableau filter type is applied last in the order of execution and is the most commonly used in everyday chart building?


3. After creating a group from the Sub-Category field in Tableau, where does the new grouped field appear and how is it identified?


Next up — Lesson 10: Hierarchies in Tableau — creating date and custom hierarchies to drill into your data from summary to detail with a single click.