Tableau Course
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.
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.
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.
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:
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:
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:
Top tab: Keep only Top N values — e.g. Top 5 Sub-Categories by Sales
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.
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.
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.
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.
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.
| 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 |
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.