Group and bin data for analysis
When you create visuals, Power BI filters, groups, and summarizes underlying data. You can refine how those groups are presented. You can also create new groups by grouping two or more data points in a visual or by putting values into equal-sized groups (binning).
Grouping is a technique for categorizing data. Binning is similar to grouping, but it's a technique for grouping continuous fields, such as numbers and dates.
You can use the grouping and binning features to display your data according to your preference. These features help you to clearly view, analyze, and explore the data and trends in your data. Additionally, can identify clusters, patterns of behavior, data averages, and more. The results of this analysis provide users with more specific insights on their data, which can help drive business decisions.
Consider a scenario where the Customer Service team now wants you to further analyze their help ticket data and asks whether you can segment the data into different groups and clusters. In particular, they want to identify the cities with the highest sales.
Create a group
The following image shows a bar chart where Power BI automatically segmented the data in the way that it found most useful: Total Sales by State. However, you want to group some of the bars (states) together so that you can view them as one category, which helps the Sales team identify the cities with the highest sales.
To create the group, use Ctrl+Click to multi-select the data points in the visual that you want to group. In this case, it's the states with sales greater than 500,000 dollars. Right-click one of those selected data points and then select Group data.
When the group is created, notice that the visual updates to show the new group. The following image shows that the other states, which are the states with lower sales (less than 500,000 dollars), grouped together and highlighted in a different shade.
The new group field displays in the Legend well of the visual, and is also added to the data model and listed in the Data pane.
When you create a group, you can change the way that the data is displayed in the visual. For example, you might want to switch the values in each axis. You can also use the group in any of the other visuals in your report. To do so, drag the group field from the Data pane and then drop it into any visual.
Edit a group
Continuing with the previous example, you now want to edit the categories that make up your group. Right-click the group field in either the Legend well or the Data pane, and then select Edit Groups.
In the Groups window, you see a list of the groups and the different items within those groups. The following image shows the States with Sales > 500k group and its members, along with the Other group (States with Sales < 500k) that contains all other values that don't belong to the first group. If you refresh your data, new items appear in the ungrouped values list and go into the Other group.
You can now make changes to the group. You can rename any group by double-clicking the group title in the Groups and members section and entering a new name. You can also add ungrouped values into an existing group, remove values from an existing group, or create a new group.
Create bin groups
The process of binning allows you to group your numerical and time field data into bins of equal size. This approach allows you to visualize and identify trends in your data in more meaningful ways. Binning allows you to right-size the data that Power BI displays.
In this example, you want to create bins (groups) for the Order Qty
field. Start in the Data pane by right-clicking the Order Qty
field that you want to create the bins for, and then select New Group. In the Groups window, set the Bin size to the size that you want, adjust other settings as required, and then select OK.
When you set up the bin group, you see a new field in the Data pane with (bins) appended to its name. You can then add that field to any visual.