Skip to main content

Command Palette

Search for a command to run...

Power BI: Creating Bins for Numeric Fields

Published
3 min read
Power BI: Creating Bins for Numeric Fields
M

Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He is studying at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).

In datasets with continuous numeric or sequential values—such as Customer IDs, ages, or sales amounts—it can be difficult to interpret individual values on a chart.
Binning (or grouping numeric data into intervals) helps summarize and visualize trends across ranges instead of single points.

In this exercise, you’ll create a Customer_ID bin to group customers into 5 equal ranges, allowing you to view total Quantity per customer group rather than for each individual customer. This is useful for identifying broader patterns, such as which customer segments purchase more frequently.

Download https://archive.org/download/powerbi_dataset/powerbi_ui_example.xlsx

Step 1 – Load the Dataset

  1. Open Power BI Desktop.

  2. Select Home → Get Data → Excel.

  3. Choose the file powerbi_ui_example.xlsx.

  4. In the Navigator window, select the Sales table.

  5. Click Load to import the data.

Step 2 – Create the Initial Chart

  1. In Report view, click on the Clustered Column Chart icon from the Visualizations pane.

  2. In the Fields pane, drag the following:

    • Axis: Customer_ID

    • Values: Quantity

  3. The chart now displays Quantity by Customer_ID, showing each customer as an individual bar (as in the first image).

Step 3 – Open the Grouping (Binning) Dialog

  1. In the Visualizations pane, locate the Axis field well.

  2. Click the down arrow beside Customer_ID (label 1 in image).

  3. Choose New group from the dropdown (label 2).

Step 4 – Configure the Bin Settings

The Groups dialog box will open (as shown in the second image).
Configure it as follows:

FieldDescriptionExample
1. FieldConfirms the field you’re binning.Customer_ID
2. Group typeSelect Bin (default).Bin
3. Bin TypeChoose how you define the bins — by Number of bins or Size of bins.Select Number of bins
4. Min valueThe lowest Customer_ID value in the dataset.101
5. Max valueThe highest Customer_ID value in the dataset.204
6. Bin countNumber of groups you want to create.5
7. Bin sizeAutomatically calculated based on your bin count.~20.6

Click OK when done.
A new field named Customer_ID (bins) will appear under the Sales table in the Fields pane.

Step 5 – Replace the Axis Field

  1. In the Fields pane, check Customer_ID (bins) to add it to the chart.

  2. Remove the original Customer_ID from the Axis section of the Visualizations pane.

  3. The chart now displays Quantity by Customer_ID (bins) — i.e., total quantity per group of customers (see the third image).

    • Each bar represents a bin range (for example, 100–120, 121–140, etc.).

Step 6 – Format the Chart

  1. Select the chart → click the Format (paint roller) icon.

  2. Update the following:

    • Title: “Quantity by Customer_ID (bins)”

    • Data Colors: Choose a clear shade of blue for consistency.

    • Data Labels: Turn On for better readability.

  3. Resize the chart and adjust axes labels as needed.

Step 7 – Save Your Report

  1. Go to File → Save As.

  2. Name it “Customer_Bins_Analysis.pbix”.

4 views