How to Create Groups in Tableau

When I was working on a Tableau dashboard to analyse sales performance, I noticed that the dataset had too many product sub-categories, like Accessories, Appliances, Chairs, Copiers and many more. From these multiple categories, we wanted to show the profit of the selected sub-categories only.

For this, it was required to group those sub-category fields. In Tableau, we can group the measures and dimensions in multiple ways.

In this Tableau tutorial, I will explain all the possible ways through which we can create groups in Tableau.

Groups in Tableau

In Tableau, grouping fields is a way to combine multiple dimension members into a single, higher-level category. After creating a group, the grouped field appears in the Data Pane and can be renamed or edited, making it reusable across multiple worksheets.

In Tableau, creating a group is useful when we want to simplify dashboards, fix data issues like spelling mistakes, or create custom categories such as “High Profit States.”

To create a group, we can either select items directly in a visualisation and right-click to group them, or use the Data Pane by right-clicking on a field and choosing Create -> Group.

Types of Groups in Tableau

In Tableau, there are three types of grouping that we use to group the fields.

  • Visual Grouping – In Tableau, visual grouping allows us to combine values directly in the visualisation. This grouping is not dynamic; that’s why if data changes, we need to regroup manually. For example, we created a group to show the top n results. For this, a new group in the Data pane is automatically created that can be used on the chart.
  • Discrete Grouping – In Tableau, discrete groups are created in the Data pane and saved as new fields. They are reusable across different views, filters, and calculations. This grouping is created when we want to correct spelling errors or create reusable custom categories.
  • Conditional Grouping – In Tableau, conditional grouping creates a group using a calculated field. In the calculation, we define a condition using the IF-ELSE conditionals. Then, the fields are grouped based on values, for example, if a customer’s profit is more than 2000, then it will be in group “high profit.”

Create Groups in Tableau

In the examples below, we will create all three types of grouping that are Visual Grouping, Discrete Grouping and Conditional Grouping.

Create Visual Grouping in Tableau

In this grouping method, we can group the fields directly from the view instead of the Data pane. In this example, we will create a grouping of the top 5 Product Sub-Category by Sales using the Tableau Superstore data set.

Now, connect Tableau with the Superstore dataset and follow the steps below.

  1. To create the bar chart view, add the Sales to the Columns and Sub-Category to the Rows.
  1. Now sort the sales in decreasing order so that we can select the top 5 sub-categories by sales.
  1. For grouping, select the top 5records and then right-click -> select Group.
Create Grouping in Tableau
  1. Now, a new group is created in the Data Pane, and the bar chart will also display the sales of the selected sub-category combined.