Power BI: Group and Bin Data

What is grouping?

Grouping allows you to combine data points based on a common characteristic. For example, if you have sales data for different products, you can group them by product category to see which category generates the most revenue.

Suppose you have a dataset with information on sales revenue, product type, and region. You would like to group the data by product type and region to gain insights into which product types perform best in each region.

  1. Open Power BI and load the dataset.
  2. Create a table or column chart in the ‘Visualizations’ pane, and drag ‘Revenue’ into the ‘Values’ section.
  3. Drag ‘Product Type’ and ‘Region’ into the ‘Axis’ (for a column chart) or ‘Rows’ (for a table) section.

You’ve just grouped your data by product type and region! This simple grouping allows you to visualize the differences in revenue across different product types and regions.

What is binning?

Binning is a technique used to categorize numerical data into discrete intervals or “bins.” For example, if you have a list of ages, you might want to bin them into age groups like 0-18, 19-35, 36-50, and so on to analyze trends more effectively.

Let’s say you want to analyze revenue generation by age group. You’ll need to bin the data based on age. Here’s how to do it step by step.

  1. Load the dataset containing customer age and revenue in Power BI.
  2. Go to the ‘Data’ view, and click on the ‘Age’ column to select it.
  3. In the top ribbon, click on ‘New Group.’ This will open the ‘Grouping’ window.
  4. To create custom bins, select the ‘Bin type’ as ‘Size of bins’ and enter the age range size (e.g., 18 for bins 0-18, 19-35, etc.)
  5. Click ‘OK’ to create the new bins.

Now, you have binned your data based on age groups.

To create a visualization with this newly binned data: 

  1. Go to the ‘Report’ view.
  2. Create a column chart from the ‘Visualizations’ pane, and drag the new ‘Age (bins)’ column into the ‘Axis’ section.
  3. Drag the ‘Revenue’ column into the ‘Values’ section.

Now, you have a visualization that shows the revenue generation by age group based on the custom bins you created. 

Related Tags: