Sunday, December 10, 2023

Lesson 10 - Slicers in Power BI Desktop

Power BI Slicers are one of the most effective and essential visual elements for creating interactive Power BI reports. A slicer acts as an on-canvas filter that allows report users to dynamically analyze specific subsets of data without modifying the underlying dataset. Power BI provides a wide range of formatting and customization options to control both the appearance and behavior of slicers. In this lesson, we will learn how to create, configure, and format slicers using the latest Power BI Desktop experience.

Power BI Infographic

🚀 Learn Power BI in 5 Minutes

Skip the long read.
See the key Power BI concepts in one easy-to-follow infographic.

View Infographic →
How to Proceed?

Step 1: Import Data and Create the Semantic Model

Launch the Power BI Desktop application, open a new report page, and import the data required for your report. When you import data, Power BI automatically creates a Semantic Model (previously referred to as a dataset). Ensure your data is loaded successfully before proceeding. Refer Lesson 7 - Power BI Semantic Model to build great visuals  


Step 2: Add the Slicer Visual

Ensure no visual is currently selected on the report canvas. On the Home tab, click Insert, and then select Slicer. Alternatively, double-click anywhere on the blank report canvas and choose Slicer from the Build a visual menu.

Note: In the latest Power BI Desktop experience, the traditional Visualizations pane is replaced by On-Object Interaction, allowing you to add visuals directly from the ribbon or the report canvas.

Step 3: Add a Field to the Slicer

Click the newly added slicer visual on the report canvas. Select the Build a visual (+) button and click Add data. Choose the required field from the Data pane to populate the slicer. Here, we have used the Region field to create the slicer.

Note: Although the slicer displays a single field at a time, you can replace it with any column from your Semantic Model depending on your filtering requirements.

Step 4: Format the Slicer

After creating the slicer, you can customize its appearance and behavior to suit your reporting requirements.

The Format pane is divided into two main sections:
  • Visual – Contains settings specific to the slicer, such as selection behavior, slicer styles, header formatting, and value formatting.
  • General – Contains settings that apply to the overall visual, such as size, position, title, effects, header icons, and alt text.
Click anywhere on the slicer and select the Format (paintbrush) icon in the right pane. Under the Visual tab, you can configure various slicer-specific formatting options.

Visual Settings


Slicer Settings

Under Visual > Slicer settings, you can customize the appearance and behavior of the slicer. These settings control how users interact with the filter and how the slicer is displayed in the report.
The available selection options include:

  • Single select – When enabled, users can select only one value from the slicer at a time.
  • Multi-select with CTRL – When enabled, users must hold the CTRL key to select multiple values. When disabled, multiple values can be selected without using the CTRL key.
  • Show "Select all" option – When enabled, a Select all option is displayed at the top of the slicer, allowing users to select or clear all values with a single click.
























Power BI provides multiple options for displaying slicer values in different layouts. The available display styles depend on the data type of the field used in the slicer, such as categorical, numeric, or date fields. You can choose the most appropriate style based on your reporting requirements and user experience.


For categorical slicers, Power BI provides multiple display styles, such as List and Dropdown. In this example, the Region field is used as the slicer, and the Dropdown style is selected to save report canvas space while providing an easy-to-use filtering experience.

For Numeric slicers we have these list of style options:

For date slicers, Power BI provides several display styles, including Between, Before, After, Relative Date, Relative Time, Dropdown, List, Vertical List, Tile, Dropdown List, Hierarchy, and Relative (available options depend on the field and Power BI version). By default, when a date field is added to a slicer, the Between style is automatically applied, allowing users to select a range of dates.














Slicer Header

The Slicer Header is the label displayed above the slicer values and is different from the visual's Title. If you want to display a title for the entire slicer visual, you can configure it separately under the General → Title settings. The Slicer Header provides the following formatting options:
  • Text
  • Border
  • Background
  • Pending Icon



                               Text

Click the Text option to customize the Slicer Header text. You can change the header text, font family, font size, font color, and text alignment. You can also apply text formatting such as Bold, Italic, Underline, and other supported font styles to improve the appearance and readability of the slicer header.







           
                             Border

Click the Border option to add a border around the Slicer Header. You can customize the border color, line style (where available), and border thickness to match your report design. In this example, the Border option is left turned off, so no border is displayed around the Slicer Header.








                            Background


Click the Background option to apply a background color to the Slicer Header. You can choose a solid color, specify a custom color using a HEX code, and adjust the transparency level. Where supported, you can also apply conditional formatting to dynamically change the background color based on your data or report logic.


                              Pending Icon


Power BI provides Apply all slicers and Clear all slicers buttons to help users manage multiple slicer selections more efficiently. Instead of applying each slicer change immediately, users can make multiple selections and then apply them all at once using Apply all slicers. The Clear all slicers option resets all slicer selections with a single click. These features help improve the report user experience and can reduce unnecessary query execution when working with multiple slicers.

The Pending icon appears only when the Slicer Header is enabled and the Apply all slicers feature is being used. It indicates that changes made to the slicer have not yet been applied when using the Apply all slicers feature. A customizable label appears next to the pending icon to notify users that the slicer selection is awaiting application.

You can customize the pending label by changing its text, font, color, transparency, and position using the settings available in the Pending Icon section. The text displayed next to the icon can be modified in the Label Text field.























                                  Values



Click the Values option to customize how the slicer values are displayed. You can modify the font family, font size, font color, background color, spacing, and other available formatting options. Depending on the selected slicer style and Power BI version, you can also customize borders and other visual properties to improve the appearance and readability of the slicer values.







General formatting

The General tab contains settings that control the overall appearance and properties of the slicer visual. The available options include Properties, Title, Effects, Header Icons, and Alt Text. Let's look at each of these options.

Properties:
Use the Properties option to adjust the size and position of the slicer on the report canvas. You can modify the width, height, and placement of the visual to suit your report layout.

Title:
Use the Title option to add a title to the slicer visual. You can customize the title text, font family, font size, font color, alignment, and other text formatting options.

Effects:
The Effects option allows you to customize the appearance of the slicer by applying a background color, border, shadow, and other supported visual effects to enhance the overall look of the report.

Header icons:
Under this we have options to set background color, color of the icon and the transparency

Alt text

Alt text improves accessibility for people who use screen readers, including people who are blind or have low vision.



When to use Slicers?

Slicers are mainly used to filter the reports across every page to maintain same context across all the pages with different charts, tables etc. and also to explore different aspects of data

Pros
  • Provide an intuitive and interactive filtering experience.
  • Allow users to explore data without modifying the underlying dataset.
  • Support dynamic report exploration and self-service analytics.
  • Improve report usability and user experience.
Cons
  • Too many slicers may affect report readability.
  • On very large datasets, multiple slicers can increase query execution time and impact performance.

Button Slicers 



The Button Slicer is a modern slicer visual in Power BI that displays filter values as interactive buttons instead of a traditional list or dropdown. It provides a more intuitive and visually appealing filtering experience, making it ideal for dashboards and reports.

Step 1

On the Home tab, click Insert and select Button Slicer. Alternatively, double-click on a blank area of the report canvas and choose Button Slicer from the Build a visual menu.

Button Slicers support both single-select and multi-select modes depending on the report configuration.

Step 2

Click the Button Slicer visual and select the Build a visual (+) button. Click Add data and choose the field you want to use as the slicer. In this example, the Continent field is used.



Step 3

The selected field values are displayed as buttons. Unlike the classic slicer, the Button Slicer provides enhanced customization options for creating modern, interactive report designs. You can customize:
  • Button shape and corners
  • Button size and spacing
  • Font and text formatting
  • Selected, unselected, hover, and pressed states
  • Fill color and borders
  • Grid layout and alignment
  • Horizontal or vertical orientation
  • Overflow behavior (Paginated or Continuous Scroll)
The Button Slicer also supports displaying images (where applicable), making it easier to create visually engaging reports.

When to use Button Slicer?


Button Slicers are best suited for reports where users need a modern, visually appealing, and interactive filtering experience. They are ideal for filtering categorical data, such as Region, Country, Product Category, Status, or Department, where users can quickly identify and select values using buttons instead of a traditional list or dropdown.

Button Slicers are commonly used in executive dashboards and business reports because they:

  • Provide a clean and modern user interface.
  • Make filter options easy to identify and access.
  • Support extensive customization, including button shapes, colors, spacing, and different button states (Selected, Unselected, Hover, and Pressed).
  • Improve the overall report navigation and user experience.

Input Slicer 


The Input Slicer allows users to type or specify numeric or date values directly instead of selecting them from a list or buttons. It is particularly useful when users know the exact value or range they want to filter.

Step 1

On the Home tab, click Insert and select Input Slicer. Alternatively, double-click on a blank area of the report canvas and choose Input Slicer from the Build a visual menu.

Step 2

Click the Input Slicer visual and select the Build a visual (+) button. Click Add data and choose the field you want to use for filtering. In this example, a Continent field is used.


Step 3

The selected field is displayed as an input box where users can type or adjust the required value. The Input Slicer supports different input methods depending on the data type, making it easier to filter data precisely.

Formatting the Input Slicer

Like other slicers, the Input Slicer provides various formatting options under the Visual and General tabs. You can customize:

  • Input box appearance
  • Font and text formatting
  • Background and border
  • Placeholder text (where available)
  • Title and Header
  • Visual effects
  • Size and position
  • Header icons
  • Alt text


When to use Input Slicer?

The Input Slicer is best suited for filtering numeric or specific values where users prefer entering an exact value instead of selecting from a list. It provides a faster and more precise filtering experience for reports containing measures such as sales, quantity, price, or other numeric data.


Clear Selections
Users can quickly clear their selections by clicking the Clear selections (Eraser) icon available in the visual header, making it easy to reset the filter with a single click.

Conclusion

With recent enhancements such as On-object Interaction, Button Slicers, Input Slicers, Apply all slicers, Clear all slicers, and improved formatting capabilities, Power BI slicers provide a flexible and user-friendly way to filter and explore report data. Choosing the appropriate slicer type helps create intuitive and interactive reports.

Useful Information


Tags Power BI
Useful links
https://www.geeksforgeeks.org/power-bi-slicer
MS Learn Modules
Test Your Knowledge Quiz

No comments:

Post a Comment