Create Bins in Power BI
Have you ever wanted to do an analysis of time? Say for instance that instead of seeing each timestamp in a set of data, you want to group those timestamps together, to obtain a count of time in a specific interval. So, for instance, dividing a 24 hour day up into time intervals of 1 hour. For example, say we have Call-Center data, and we want to see the times during the day where Call-Center operators are usually the most productive. In other words, when are the most calls being made? In this instance, binning in Power BI is ideal for grouping units of time into “bins” of the same size. Which will, in turn, allow us to identify trends in the data such as when the most calls were made compared to the least.
In this blog, I will show you how to create a useful way of seeing the hours at which the most calls were made. The steps in this blog can also be applied to other types of dashboards as well, like sales data where you need to group say, sales categories, and so on. The end result of the binning in this blog will look like this:
Steps required for creating bin groups
In this example, I used call center data and the “ONTIME” field. The “ONTIME” field is defined as the time that each call was made.
Before we begin, let’s just have a look at what each timestamp looks like in a matrix visual, count of time:
From the above matrix visual, you can see, that it is quite difficult to see a specific trend of time when the most calls were made because the level of detail is very granular. We want to see detail, that is less granular and easier to interpret. This is why binning and grouping is such a powerful method of analysis.
Moving on to the steps then…
Make sure that your data type is correct.
When we navigate to the Power Query Editor and take a closer look at the “ONTIME” field, we see that the type is set to time.
Create a New bin (group)
In the Field pane, right-click on the ONTIME field that you want to create the bins for. Then select New Group.
Then on the Groups window that displays, you need to set the Bin size to the size that you want.
Create the visual required to analyze productivity levels.
Just a side-note:
For this analysis, you want to view the data in a categorical format instead of continuous. So, once you’ve created your visual, you can format the Axis where the Bins are on, in this case, the Y-axis, and select Categorical.
The result of which will look like this:
That’s it, as easy as pie!
For more insightful Power BI blogs, please visit our website at the following link:https://databear.com/blog/
For additional material on grouping and binning, you can also visit the official Microsoft literature at https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning
Learn more about Power BI by enrolling on our training.