Create Groups in Power BI

Power BI Grouping is the process of combining or merging two or more values for further analysis. For example, When we are seeing products by category report, we may find very few records (unnoticeable products). Sometimes, it may be annoying to see all those underperforming products. In this situation, you can create a Power BI group by combining those records, and display it as one product.

In this article, we show you how to create groups in Power BI reports with an example. For this Power BI groups demonstration, we are going to use the SQL Data Source that we created in our previous article.

Please refer Connect to SQL Server article to understand the Power BI Data Source.

Create Groups in Power BI

To visually demonstrate this Power BI grouping technique, we will create a Pie chart. As you can see from the below screenshot, we created a Pie chart by dragging the Sales Amount column to the Values field and the Color to the Legend region.

NOTE: I suggest you refer to Create a Pie Chart and Format Pie Chart article to understand the steps involved in creating and formatting a pie chart.

Pie Chart 1

If you observe the below screenshot, Data that we highlighted, such as Multi, NA, and Blue color products, are not performing well. So, let us group them

Highlight a slice 2

To perform grouping in Power BI, Please select the fields that you want to group, and right-click on it will open the context menu. Please select the Group option from the menu.

Create Groups in Power BI 3

Once you click on the Group option, Power BI will automatically group those items as shown below. That’s it, we did the grouping.

If you observe closely, the Legend section is replaced by the Color group, and the color is placed in the details section.

TIP: By default, the Power BI Group option will group the selected items as one group and the remaining options as another group.

Create Groups in Power BI 4

Let me remove the Color field from the Details section. Now you can see only two partitions in the Pie chart: one contains Blue, White, and NA colors, and the second partition contains the remaining colors.

Change the Legend Field 5

Edit Power BI Group

Please select the group that you want to edit, and right-click on it will open the context menu. Select the Edit Groups option from it

Create Groups in Power BI 6

Clicking the Edit Groups option will open the following window.

  • Name: Specify the Group name
  • Field: The field or Column that you used for grouping
  • Group Type: List (group) or bin.
  • Ungrouped values: Fields that are not grouped but available in this column.
  • Groups and Members: List of groups and their members.
  • Include Other Group: Do you want to place all the ungrouped members in the Other group? If so, checkmark this option.
Create Groups in Power BI 7

Let me uncheck the Include Other groups. This will remove other group

Include Other Group option 8

Now you can see the pie chart that displays all the colors and one group that contains Blue, Multi, and NA colors.

Create Groups in Power BI 9

Remove Power BI Group Members

To remove Power Bi group members, Please select the group member that you want to remove, and click ungroup button. For the demo purpose, we are removing the Blue colour.

UnGroup button to delete 10

Now you can see that the Blue color is removed and added under the ungrouped values.

Ungrouped values 11

And our pie chart displays all the colors and one group contains Multi and NA colors.

Create Groups in Power BI 12

Rename a Group in Power BI

Double-click on the group that you want to rename, and provide a valid name. Let me rename it as White & Multi & NA

Rename it 13

From the below screenshot, you can see that the group name has been renamed.

Add a Member to Groups in Power BI

Please select the group member that you want to add, and select the group as well. Next, click on the Group button.

For the demo purpose, we are adding White color to an existing group.

Create Groups in Power BI 14

Now you can see the White color under the group

Add a New Member 15

Create a New Group in Power BI

Please select the field for which you want to create a group, and click the group button. For the demo purpose, we are selecting the Yellow color.

Create Groups in Power BI 16

Now you can see the new group.

Change Group Name 17

Let me add a few more fields to it

Create Groups in Power BI 18

Now you can see our pie chart has four colors, and they are Black, Red, and two groups.

Pie Chart using Groups 19

Once you create a Group in Power BI, it will act like any other column or field. So, you can use it in N number of charts.

To demonstrate the same, we created a Column chart that shows the Country wise sales.

Create Groups in Power BI 20

Next, we added the Color group in the legend section.

Create Groups in Power BI 21

The second approach to create Groups in Power BI

Please select the field that you want to use as a group, and right-click on it will open the context menu. Select the New Group option from the context menu.

Create New Group option in Desktop 22

This will open the following window.

Ungrouped values and Groups and Members 23

Sometimes, it will open the same window with a different option, as shown in the below screenshot. But, don’t worry, you can change the Group type from Bin to List.

Change Group Type 24

Once you changed that property, you are good to go.

Create Groups in Power BI 25