top of page

Grouping and Binning in Power BI

Writer's picture: Bernard KilonzoBernard Kilonzo
person typing on a laptop

Overview

Grouping data in Power BI is a powerful technique used to aggregate data points based on common fields, allowing for more effective summarization and analysis of datasets. This feature helps in identifying trends and patterns by combining similar items into categories.

Binning on the other hand is a technique used to categorize numerical data into predefined intervals or ranges, known as bins. This helps in simplifying complex data sets and enhancing data visualization by grouping similar values together. Binning is particularly useful for analyzing trends and patterns in numerical data.

Step-by-step Guide

One of the common use cases of the grouping feature is.

  • Correcting data errors e.g. combining Africa, Afrika, Afric, African, Afrikan into a single data point ‘Africa’

  • Answering what-if type of questions e.g. What would happen if we combined East and West regions?

For example, using the Sample – Superstore dataset, you can easily find out the combined performance of East and West regions by simply grouping the two regions to create a single region called “New Region”.

To do so,

  • Right-click on Region

  • Select New group

creating a group in power bi

On the pop-up menu, rename your new field or leave it in its default form “Region (groups)”.

Using CTRL+ select, select all the values you need to group - and group them by selecting the “Group’ option at the bottom left.

Rename the grouped values - in this case I have renamed them as “New Region” as shown below.

configuring groups in power bi

Using now the new field “Region (groups)”, you can find the combined performance of these two regions by building a simple bar chart as shown below. From this bar chart, you can instantly tell that the two regions (namely East and West) generated approximately 1.4M in sales.

A bar chart view

The same procedure applies when you need to group numerical data, only that in this case it’s called binning.

For example, I can group the Discount values into bins to establish how many orders fall into certain bins (groups).

To do so,

  • Right-click on Discount

  • Select New group

creating bins in power bi

On the pop-up menu,

Customize your new group by assigning the right name, select your bin type, and choose your bin size.

In this case, I will configure my bins based on “Size of bins” - whereby I will set the bin size as 0.2 (Note the Min and Max values are 0 and 0.8 respectively).

configuring bins in power bi

With this grouped field, you can easily see the distribution of orders by the bins using the view below.

a column view

From the above view, you can instantly tell that around 4944 orders didn’t have discounts, while 3911 orders had a discount of 0.2 – information that would not easily come-out without grouping the numeric values into bins.

Conclusion

Grouping and binning are powerful data visualization techniques in Power BI that enable users to categorize data into meaningful groups, enhancing analysis and visualization. Grouping allows users to combine similar items into categories, which is particularly useful for text-based data or when creating custom categories. Binning, on the other hand, is used to segment numerical data into defined ranges, making it easier to analyze trends and patterns.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page