12. Data Hierarchies and Groups
12.6 Bin Groups (Numeric and Date Bins)
Start with a problem
Amir wants to know how many deliveries take 5–9, 10–14 and 15–19 minutes.
Explain simply
Bins turn a numeric (or date) column into equal-width ranges. Each value is labelled with the lower edge of its bin.
Show the data
| Order ID | Delivery Mins | Amount (₹) |
|---|---|---|
| 301 | 8 | 400 |
| 302 | 12 | 200 |
| 303 | 14 | 300 |
| 304 | 9 | 150 |
| 305 | 7 | 450 |
| 306 | 16 | 250 |
| 307 | 11 | 350 |
| 308 | (blank) | 0 |
About this data: This table uses columns: Order ID, Delivery Mins, Amount (₹). This table uses columns: Delivery Mins (bins), Orders. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).
Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).
Demonstrate
- Right-click Orders › Delivery Mins › New group.
-
Group type Bin, Bin type Size of bins, Bin size
5› OK.Your result should look like this:
Delivery Mins (bins) 301→5, 302→10, 303→10, 304→5, 305→5, 306→15, 307→10, 308→(Blank) -
Clustered column chart: X-axis Delivery Mins (bins), Y-axis Count of Order ID; X-axis type Categorical.
-
Amount bins: right-click Amount › New group › Bin › Size
100.Your result should look like this:
Amount (bins) 0, 100, 200, 300, 400
Show the result
Your result should look like this (fictional sample):
| Delivery Mins (bins) | Orders |
|---|---|
| 5 (5–9 min) | 3 (301, 304, 305) |
| 10 (10–14 min) | 3 (302, 303, 307) |
| 15 (15–19 min) | 1 (306) |
| (Blank) | 1 (308, cancelled) |
Explain what happened
Each value was rounded down to a multiple of 5: 8 → 5, 12 → 10, 16 → 15. The cancelled order has no minutes, so it lands in (Blank).
Explore further
- Bins are equal-width. For business bands like 0–10 On time / 11–20 Late, use a calculated column (12.7).
Detailed reference for this lesson:
Bins turn a numeric or date column into equal-sized ranges. They are perfect for histograms.
Steps in Power BI – delivery time bins
- Right-click Orders › Delivery Time Mins › New group.
- Group type: Bin. The dialog shows the Min value and Max value of the column.
- Bin type: Size of bins › Bin size
5› OK. A field Delivery Time Mins (bins) appears with values 0, 5, 10, 15 … (each is the start of a range: 5 = 5–9.99 minutes). - Build a clustered column chart: X-axis = Delivery Time Mins (bins), Y-axis = Total Orders. Set the X-axis Type to Categorical if you want every bin labelled.
- Order value bins: right-click Orders › Amount › New group › Bin › Size of bins
100→ ₹0–99, ₹100–199 … - Number of bins: choose Bin type Number of bins ›
10. Power BI calculates the size from the min and max. This is quick for exploration, but the edges are odd numbers. - Date columns can also be binned (for example by 7 days).
Ravindra Bagale's Tip
Friends, don't make a mistake here: bins are fixed from the column values, and outliers stretch the range, so one 500-minute delivery creates many empty bins. Clean outliers first. Also check the grain: for order-value bins, bin an order-level value, not the per-line Amount. This matters for both exams and interviews.
Ravindra Bagale's Tip – मराठी
मित्रांनो, इथे चूक करू नका: bins column च्या values वरून fixed होतात, आणि outliers range ताणतात, त्यामुळे एकच 500-minute delivery अनेक रिकामे bins तयार करते. आधी outliers साफ करा. Grain पण चेक करा: order-value bins साठी order-level value चे bins करा, प्रत्येक line चा Amount नाही. हे exam आणि interview दोन्हीसाठी important आहे.
Ravindra Bagale's Tip – हिंदी
दोस्तों, यहाँ गलती मत करना: bins column की values से fixed होते हैं, और outliers range को खींच देते हैं, इसलिए एक 500-minute delivery कई ख़ाली bins बना देती है. पहले outliers साफ़ करो. Grain भी check करो: order-value bins के लिए order-level value के bins बनाओ, हर line का Amount नहीं. यह exam और interview दोनों के लिए ज़रूरी है.
Practice task
Create bins of 5 minutes for Delivery Time Mins and ₹100 for Amount. Build two histograms and a slicer on Platform to compare Blinkit and Amazon Now distributions.
Fix common mistakes
| Wrong result | Reason | Correction |
|---|---|---|
| Viewers read bin 5 as exactly 5 minutes | The label shows only the lower edge | Rename the axis title: Minutes (5-minute bins, lower edge) |
| Empty bins are missing from the chart | Categorical axis hides items with no data | Turn on Show items with no data, or use a continuous axis |
| The cancelled order appears in the histogram | (Blank) bin shown | Filter Status = Delivered |
Practise independently
Practice task
With ₹100 Amount bins, how many orders fall into each bin?
Hints
- 150 → 100, 250 → 200, 350 → 300, 450 → 400.
Solution
0: 1 (308); 100: 1 (304); 200: 2 (302, 306); 300: 2 (303, 307); 400: 2 (301, 305). Total 8.
Think like a professional
A histogram answers "how spread out?". Pick a bin size people can say out loud (5 minutes, ₹100) rather than the default.
Loading DAX practice tasks...
- Ten-minute wait bin (Easy): Calculated column on Visits: Wait Bin = WaitMins ÷ 10, decimals dropped, times 10. Example: 25 becomes 20.
- Visit month (Easy): Calculated column on Visits: Visit Month = the month number of VisitDate.
- Half of the month (Easy): Calculated column on Visits: Half = "1st half" when the day is 15 or less, else "2nd half".
- Wait bands (Medium): Calculated column on Visits: Wait Band = "0-15" up to 15, "16-30" up to 30, else "31+".
- Fee band (Medium): Calculated column on Visits: Fee Band = "High" for 1000 or more, "Mid" for 800 or more, else "Low".
- Fifteen-minute upper bin (Medium): Calculated column on Visits: Wait Step = WaitMins ÷ 15 rounded up to a whole number, times 15. Example: 20 becomes 30.
- Long waits per department (Medium): Shown per Department. Measure: Waits 31+ = number of visits with WaitMins more than 30.
- Short waits per visit type (Hard): Shown per VisitType. Measure: Short Waits = number of visits with WaitMins 15 or less.
- Fees in the middle bin (Hard): Shown per Doctors City. Measure: Mid Wait Fees = [Total Fees] for WaitMins above 15 and up to 30.
- Share of visits in August (Hard): Shown per Department. Measure: Aug Share = visits in month 8 ÷ all visits.
Revision card
Interview card