I was doing some online shopping last week and saw a price slicer with a histogram to show the concentration of price points. I thought it was pretty cool, so decided to see if I could build this in Power BI. I came up with a solution that works, and in this article I show you how you can do it yourself.
Slicer with Histogram
Here is the final product (below). Note how the histogram shows the price points, including those that have not been selected with the slicer.
For illustration, I used the Products table in the Adventure Works database with the List Price in the slicer. When you select the list price range, the histogram updates to show the price range selection.
How to Create a Slicer Histogram
This is how I created the slicer with histogram.
- Placed a slicer with List Price as the Field. The price list field is numeric, so the slicer is a “slider” by default.
- Placed a column chart with List Price as the Axis and Product Key as the Value (count of product key).
- Placed the column chart below the slicer and adjusted the size to align with the slicer.
- This histogram displays the number of products in the selected price range
- Duplicated the histogram, changed the column colour to grey, and turned off edit interactions for this copy.
- Placed the grey copy of the histogram behind the main histogram.
I have produced a short video showing you the end to end process here.
You can download the Products Table here.