Power BI slicers are interactive filters that allow us to easily refine and analyze specific parts of our data. They provide a simple way to focus on important part of a dataset which helps in making data exploration and decision-making faster.
A slicer helps filter data directly in our report such as selecting specific Employee Names or Salary ranges to display only the relevant information we need.
Creating a Slicer In Power BI
We'll see the steps to create a hierarchical slicer using a dataset named Employee Table which includes the Employee Name and Salary columns.
You can download dataset from here.

Follow these steps to create a slicer:
Step 1: In the Visualizations pane, click on the Slicer option to add it to the report.

Step 2: An empty slicer will appear on the report canvas in Power BI.

Step 3: We have only one section in Power BI slicers i.e Fields. In the Fields pane, drag and drop the relevant columns such as Employee Name and Salary into the slicer. This will allow us to filter data based on these fields.

Formatting a Slicer In Power BI
Once we've created a slicer in Power BI, we can further customize its appearance and functionality through various formatting options. These options include adjusting the slicer’s title, color, position, slicer settings and hierarchy structure. Formatting is split into Visual Formatting and General Formatting.
Visual Formatting
Visual formatting focuses on adjusting the visual aspects of the slicer. This includes Slicer Settings, Slicer Header, Values and Hierarchy.

1. Slicer Settings
Slicer settings allow us to find the type of filter selection. There are three options:
- Single Select: Allows only one item to be selected at a time.
- Multi-Select with CTRL: Enables multiple selections while holding the Ctrl key.
- Show "Select All": Adds a "Select All" option for quick selection of all items.

Steps:
1.1 Enable Multi-Select with Ctrl and Show "Select All" to On. We will now see the Select All option appear and we can select multiple options like Arushi and Gautam.

2. Slicer Header
Slicer header refers to the title displayed above the slicer. It’s different from the visualization title which can be set separately. We can adjust Text, Border and Background for the slicer header.

Steps:
2.1 Click on the Text option. We have multiple options available. We can customize the heading of the slicer, Font can be used, change the heading size and also change the Font color.

2.2 Click on the Border option. We can add a border to the slicer heading. Check the Bottom box and a line appears under the slicer heading. We can change line width and also the color of the Border.

2.3 Click on the Background option. We can set the background color of the slicer heading. Here we are keeping it white.

3. Values
Values are the actual data points displayed in the slicer. These are the items we can filter by such as Arushi and Gautam. We have 3 options i.e Values, Border and Background.

Steps:
3.1 Click on the Values option. We have multiple options available where Font can be used, change the slicer values size. We can also change the Font color(e.g Pink) and also change the value for Padding.

3.2 Click on the Border option. We can add a border to the slicer values. Check the Bottom box and a line appears under the slicer values. We can change the color of the Border(e.g Blue) also the line width.
Note: The border color cannot be different for slicer header and slicer values, PowerBI automatically converts them to the same color.

3.3 Click on the Background option. We can set the background color of the slicer values. Here we are keeping it white.

4. Hierarchy
Hierarchy allows us to create nested slicer values which can added one after the other into the fields section. For example, salary can be a nested value under Employee Name. There are 2 options in this i.e Levels and Expand/Collapse.

Steps:
4.1 Click on the Levels option. This is used to set an indentation to the nested slicer values. For example we can view in the below image that, the position of the salary value has been changed and shifted to the right.

4.2 Click on the Expand/Collapse option. A drop-down appears. We can change the icon of the expand/collapse button. For example, we are setting the buttons to plus/minus.

General Formatting
General formatting refers to more layout-based and overall visual adjustments including Property, Title, Effects and Alt Text etc.

1. Property
Properties are options like Size, Position and Advanced Options. These are used for resizing and repositioning visuals on the report canvas. Advance option comprises adding a layer order which is rarely used.

2. Title
We can add a title to the visualization which appears at the top of the slicer.
Steps:
2.1 Click on the Title option. A drop-down list appears. Add the title under the Text section (here Slicer). We can see in the image a title is added to the visualization. As done previously we can customize the size, font type of the slicer etc.

2.2 We can also change the color of the title. Under the text color select the required color (blue in this case).

3. Effects
The effects section includes Background, Visual Border and Shadow. These options allow us to add background colors, borders and shadows to our slicer.

Steps:
3.1 Click on the Background option. Select the color of the background accordingly(here black). We can see in the below image that the background of the slicer changed to black.

4. Header Icons
These are the icons that appear at the top of the visualization such as Filter on Visuals, More Focus and More Options. We can customize the background, border and icons here.

5. Alt Text
Alt text is useful for accessibility purposes. It allows screen readers to describe the slicer’s contents for users who cannot see the visualization.

With these formatting techniques, we can create dynamic and visually engaging slicers in Power BI which helps in making our data analysis more interactive and tailored to our needs.