Slicer with Histogram in Power BI

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.

The Video

You can download the Products Table here.

6 thoughts on “Slicer with Histogram in Power BI”

  1. To make the histogram axis dynamic, create calculated table to your model with DISTINCT([histogram axis value]), and add a relationship back to the fact table. Then set the histogram axis to the newly created column instead of the one you use to filter, and axis to “show items with no data”. Now you don’t need to manually set the axis min/max to match the filter values anymore.

  2. Your posts are always a good mix of DAX and practical presentation/Power BI functionality tips. Keep up the good work.

  3. Would you be able to provide the sample data used to create it just so I can try it myself? I currently do not have sample data to use.

Leave a Comment

Your email address will not be published. Required fields are marked *