Chapter 9. Slicers and Filters

In this chapter, we will discuss an important tool that is part of the basic visualizations in Power BI: the slicer. It is a utility element, meaning it does not visualize data itself but allows filtering of the charts on the dashboard based on a selected field. In practice, no Power BI report is complete without slicers.

The conversation about slicers becomes relevant when we have at least one chart that we want to filter. By default, any slicer filters all visual elements that have related data, including other slicers. We will demonstrate how to influence this option later on, but for now, let’s understand how to build slicers and the different types they can be.

In Figure 9-1, a fragment of a dashboard with a slicer for countries is presented. After selecting Great Britain in the slicer, the charts on the right show sales by categories and monthly sales dynamics in that country.

Figure 9-1. The slicer filters both charts based on the selected country (Great Britain)

In most tasks, slicers are built based on categorical data (such as countries, products, managers, etc.) or dates, and less frequently on quantitative values. In the case of dates and numerical values, the slicer can take the form of a slider—we drag its edges to adjust the range. In Figure 9-2, the first slicer selects the period from March 11 to August 12, while the second slicer ...

Get Data Visualization with Microsoft Power BI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.