Create Bins in Power BI

Power BI Bins or buckets help create a range of data, similar to SQL Buckets. Let me show you how to create bins with an example.

For this Power BI bins demonstration, we will use the SQL Data Source we created in our previous article. So, Please refer to the Connect to the SQL Server article to understand the Data Source.

Create Bins in Power BI

To visually demonstrate these bins, we will create a Table. As you can see from the screenshot below, we created a simple Table by dragging the Product Key and Sales Amount columns.

Please select the field that you want to use as a Power BI bin and right-click on it to open the context menu. Then, select the New Group option from the menu.

I suggest you refer to Create a Table and Format Table article to understand the steps involved in creating and formatting a Power BI Table.

Choose New Group Option to Create Bins in Power BI 2

Clicking the New Group option opens the following window.

  • Name: Specify the Power BI Bin name
  • Field: Field or Column that you used for binning
  • Group Type: List (group) or bin.
  • Bin Type: There are two options such as the Size of Bins or the Number of Bins
  • Min and Max Value: Minimum and maximum values present in the selected Fields. Here is the Product Key.

If you selected the Bin Type as the Size of Bins, then you have to specify the Bin size (static Number). Alternatively, if you selected the Bin Type as the Number of Bins, you must specify the bin count. Here, Bin size depends upon the Bin count.

Specify the Name, Group Type, Field, Size, and Count 4

Let me keep the default Bin Type as the Size of Bins. Next, select the Bin size as 20 and click OK. It means each bucket size is 20.

Change the Size from Default in Create Bins in Power BI 5

Now you can see the newly created bin under the Product table.

Newly Added Field 6

Let me add that bin to this table. From the below screenshot, you can see that the product Key value is 220 for the keys between 220 to 240

Create Bins in Power BI 7

Edit Power BI Bins

Please select the bin you want to edit and right-click on it to open the context menu. Select the Edit Groups option from it

Edit newly Created Bins in Power BI 8

Clicking the Edit Groups option opens the following window. Use this window to change as per your requirement.

Change Bin Type 9

Delete Bins in Power BI

Please select the bin you want to delete and right-click on it to open the context menu. Select the Delete option from it

Choose Delete Option from Context Menu 10

Click the Delete button to confirm the delete operation.

Create Bins in Power BI Example 2

To demonstrate the Bins, we created a Column chart that shows Color-wise sales. This time we create a bin on Sales Amount

Add Dimension to Axis and Measure to Values for Bar Chart 12

Right-click on the Sales Amount and select the New Group option from the context menu. As you can see from the below screenshot, we defined the Bin size as 357.2655

Groups Window to edit the type, min value, max value, and size 13

Let me add this new Sales Amount bin to the Column chart legend section.

Create Bins in Power BI 14

Let me Edit it, and change the Power BI Bin type to Number of Bins, and Bin count to 3

Change Count 15

Now you can see each bar in the column chart is divided by a bin of count 3.

Create Bins in Power BI 16