2026 Week 39 | Power BI: Histograms with adjustable bin width

Introduction

Two sites of the same walk-in clinic report the same average wait: 14.8 minutes at Site A, 14.8 minutes at Site B. On a KPI card they are twins, and there is nothing to discuss.

Then you look at the 2,400 individual waits. Site A runs mostly quick, with a tail that drags out to 42 minutes. Site B never exceeds 22 minutes, but its waits pile up around two values, 13 and 17, with a dip in between. Two different processes wearing the same number.

A histogram would have said that in one glance. Power BI has no standalone histogram visual, but a standard column chart can easily be converted into one.
What do we need to change? By default, Power BI displays it like a categorical char with a gap between every bar, plus a half-bar of air at each end of the plot area. Both are settings. Under Columns > Layout, space between categories and outer padding both go to 0%, and the column chart turns into a real histogram.

The next part is the bins. How wide they are is a choice you make, and it changes the picture. At 1 minute per bin, Site B clearly has two humps. At 5 minutes per bin, they merge into one broad block and the story is gone. This week you build the bins in DAX and hand the bin width to the reader with a slicer. Then click through the widths and see what a single fixed choice would have hidden.

What a histogram actually is

A histogram sorts every observation into an interval and shows how many landed in each one. Here each bar covers a range of waiting minutes and its height is the number of patients who waited that long. The bars touch because the ranges touch: 12 to 13 minutes ends exactly where 13 to 14 begins.

Karl Pearson coined the word in his lectures in the early 1890s. He described columns whose areas mark the frequency over the range of their base. So the area carries the count. With equal bin widths, area and height are proportional and the difference stays invisible. Make one bin twice as wide and it shows: to keep the area right, the same count gets half the height.

This week all bins are equal, so the height is simply the count of cases.

Dataset

The dataset is a single Excel file found on Github here: link

Requirements

    1. Load the data and build two helper tables. A bin width table with the values 1, 2, 5, 10. A bin axis table with every integer from 0 to 45. Neither one has a relationship to the fact table.
    2. Write one measure that counts cases per bin. It reads the selected bin width, keeps only the bin starts that sit on the grid of that width, and returns 0 rather than blank for bins that happen to be empty. At width 5 your axis shows 0, 5, 10, 15. At width 2 it shows 0, 2, 4, 6.
    3. Turn the column chart into a histogram. Bin start on the x-axis, your measure on the y-axis, axis type categorical. Then space between categories 0% and outer padding 0%. The bars touch each other and touch both edges of the plot area.
    4. Split by site. Small multiples by location, 2 rows and 1 column, and give the visual the full page width. Above it four cards: mean and standard deviation for each site, one decimal. Both means read 14.8, the standard deviations read 5.3 and 2.7.
    5. Add the bin width slicer as a tile slicer with single select, so the shape changes on one click. Start it on 2.
    6. Optional, advanced. On a second page, unequal bins: fine intervals in the middle, coarse ones in the tails, with the height showing cases per minute so the area still equals the count. Pearson’s original definition, the hard way.

Share

After you finish your workout, share on BlueSky or LinkedIn using the hashtags #WOW2026 and #PowerBI, and tag @MMarie, @shan_gsd, @KerryKolosko (on BlueSky). And tag me, Diana Ackermann on LinkedIn. 

Solution

Download from the Gallery