Power BI: Creating Bins for Numeric Fields

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
Open Power BI Desktop.
Select Home → Get Data → Excel.
Choose the file
powerbi_ui_example.xlsx.In the Navigator window, select the Sales table.
Click Load to import the data.
Step 2 – Create the Initial Chart
In Report view, click on the Clustered Column Chart icon from the Visualizations pane.
In the Fields pane, drag the following:
Axis:
Customer_IDValues:
Quantity
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
In the Visualizations pane, locate the Axis field well.
Click the down arrow beside
Customer_ID(label 1 in image).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:
| Field | Description | Example |
| 1. Field | Confirms the field you’re binning. | Customer_ID |
| 2. Group type | Select Bin (default). | Bin |
| 3. Bin Type | Choose how you define the bins — by Number of bins or Size of bins. | Select Number of bins |
| 4. Min value | The lowest Customer_ID value in the dataset. | 101 |
| 5. Max value | The highest Customer_ID value in the dataset. | 204 |
| 6. Bin count | Number of groups you want to create. | 5 |
| 7. Bin size | Automatically 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
In the Fields pane, check Customer_ID (bins) to add it to the chart.
Remove the original Customer_ID from the Axis section of the Visualizations pane.
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
Select the chart → click the Format (paint roller) icon.
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.
Resize the chart and adjust axes labels as needed.
Step 7 – Save Your Report
Go to File → Save As.
Name it “Customer_Bins_Analysis.pbix”.