Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Watsky

Give users the ability to change a slicer on a published report

Introduction

It is so nice that we, the report developers, have the ability to pick from multiple slicers.Watsky_3-1641421948880.png

Slicer menu

It is not so nice that our end users do not have that luxury. They are simply out of luck.

 

Watsky_2-1641421894236.pngSlicer menu missing once published

 

What if there was a fairly easy way to give them the power? This article will show you how you can build menus for your slicer so that it looks and functions just like the real deal. This tutorial assumes you already have a slicer built with information loaded into the slicer. So, you will only see the slicer in the example. 

 

Assumption

Before we begin, I am making the assumption that you already have a slicer on a report and it is located in the positon on your report where you no longer are moving it around. If this is not the case you want to start preparing by loading a report with a slicer you want to build this for or create a new report with a slicer. 

 

The setup

First we will turn on the Bookmarks and Selection Panes. To do this simply click on View and select the Bookmarks and Selection Panes. Since I only have one (1) visual all that is shown in the Selection pane is Slicer. If you have multiple slicers on your report then you will want to rename them to more descriptive names in order to find the slicer easier.  

 

Changed Name                                 Original Name

Watsky_4-1641422962685.png

     Watsky_5-1641422973650.png

 

Here is the list of operations to perform:

  1. Create the menu icon;
  2. Create the slicer menu base;
  3. Create the fields;
  4. Group the objects;
  5. Setup the actions;
  6. Adjust the bookmarks; and
  7. Test and Publish

 

Original menu

If you're looking to create a menu which is identical from the original take a moment to view the original. Also make note of all of the options you are looking to recreate. 

 

Creating the Menu icon

Looking at the original you will see that icon is a V. We cannot get the exact icon so for this I used a Cheveron Arrow (feel free to use what you would like and skip the rest of the Menu Icon formatting steps below)

  • On the top Power BI ribbon click on Insert;
  • Click Shapes then select the shape you want to use;

Watsky_8-1641425202348.png

  • On the Selection panel rename the shape to Slicer Icon;
  • Watsky_9-1641425659889.pngOn the Format Shape pane under Shape click Rotation;
  • Change the All rotation to 90°;
  • Next, shrink the size of the icon by clicking on one (1) of the corners of the shape and dragging it inward; then
  • Move the shape so that it closely aligns with the original slicer menu.

 

Creating the slicer menu base

To create the Slicer Menu:

  • Start by inserting a rectangle shape;
  • Click the rectangle;
  • Move the rectangle to right beneath your menu icon; then
  • Click on the original menu button.

Watsky_11-1641426385363.png

 

Rectangle before resizing

 

The menu will open in front of your rectangle. Use this as a guide to get the rectangle down to the exact height and width as the original. It does not have to be perfect.

 

Rectangle behind original menu. Notice the blue in the left bottom corner.

Watsky_13-1641426455358.png

 

Without the original menu opened.

Watsky_14-1641426607382.png

 

With everything lined up and sized we can remove the background color.Watsky_0-1641507556529.png

  • Click on the rectangle;
  • On the Format shape pane navigate to Shape, Style, and then to Fill; 
  • Change the color to white; 

Beneath the fill section is the border section.

  • Click on this and change the color to the lightest gray;

Watsky_6-1641480901244.png

 #E6E6E6

 

Still within the border section.

  • Change the width to 0.5 px; then

 

Watsky_5-1641480661473.png

 

  • Click on the shadow section, which is found beneath the border and text sections.
  • Set the transparency to 95%.

 

Watsky_3-1641480575508.png

 

Create the fields

It is time to create the fields. The fields are created using the blank button element.

  • On the top ribbon click Insert, then Buttons, lastly Blank;

For now, just create one (1).

  • On the Selection pane, find your newly created button and double click on it;
  • Name the button the name of the field it will represent. For instance Between;

Watsky_10-1641483497097.png

    • Click on the button;Watsky_0-1641526092199.png
    • On the Format button pane and under the Button section, navigate to Style then Text;

 

Turn on Text;

    • Give the field a name;
    • Set the Horizontal alignment to left;
    • Set the left Padding to 7 px;

The other padding should remain 4 px. 

    • Navigate to the Border section, which is found beneath Text, Icon, and Fill;
    • Turn the border Off; Watsky_9-1641483278989.png

At the top of the Style section you will see the option Apply settings to.

    • Change the state from Default to On hover;

      Watsky_11-1641483630751.png

  • In the Text section change the font color to white;
  • Find the Fill section beneath Text and Icon sections; and
  • Turn Fill on then change the color to blue.

Watsky_13-1641483863538.png

#118DFF

This emulates the same action we see when we hover over the fields of the original (the field background turns blue and the text font turns white). 

  • Copy the button for as many fields as you need;
  • Change the name for each in two sections:
    • In the Selection Pane; and
    • the field's text section of the Format button pane. 

 

Watsky_14-1641485501111.pngWatsky_15-1641485543816.png

 

Now, select all of the fields and move them into the menu base. Organize them however you would like. Make sure that the size of the field is not longer than the menu base. If the field is longer then shorter the width so that it fits inside the base.

 

Watsky_16-1641486734967.png

All fields inside the base

 

Grouping the menu base objects

Now that we have our menu completed our next step is to group all the menu base objects. Select all the objects that make up the slicer menu. The only exception is we do not want to select the menu icon. Just the items the make up the menu. There are a bunch of different ways to select all the items. One (1) way is by navigating to the Selection Pane then click on the first object needed. Find the next object needed and hover your mouse cursor over it.  On your keyboard, hold down the Shift key then left click on the object. Repeat this for the remaining objects. 

Watsky_17-1641487503274.png 

There are also multiple ways to group the objects. One (1) way is to click on Format on the top ribbon, click Group, then click Group (in the submenu).

 

Watsky_18-1641487655564.png

 

Now our objects are grouped together. You can change the name of the group in the Selection pane if you want to have everything labeled properly. However, it is not requiried. 

Watsky_20-1641487806788.png

Caret next to Slicer Menu shows you that the objects are grouped.

 

Setup the bookmarks

To begin setting up the bookmark we need to add actions to each field so that when the field is clicked it changes the view of the slicer. Currently the menu is opened so we will begin by creating that view. Start by selecting the Slicer menu group and the Slicer icon from the Selection pane.

 

Watsky_0-1641499686859.png

 

Why did we change the selection from all visuals to selected? This is done so that when the user clicks the icon the only change we will see is the menu appearing. If we left it with all visuals any time we are on a slicer view that isn't the default view and we click the icon it will revert the view back to default. For instance if I have the slicer set to List but my default view is Between, click the menu icon, then the menu will load and revert the slicer to the Between view. 

 

                                              Watsky_1-1641499820546.pngWatsky_4-1641499899099.pngWatsky_5-1641499948661.png

Without changing the selection this results in the entire view change back to the default view.

 

To create the next bookmark:

  • Simply hide the menu group on the Selection pane;
  • Click Add on the Bookmark pane;
  • Rename this on the Bookmark pane as the name of the field. My first one is called Between;

 

Watsky_6-1641500386696.pngWatsky_7-1641500491204.png

  

  • Using the original controls of the slicer select your next field from your list;

Watsky_8-1641500728509.png

Make sure you are not clicking on the icon we created but the original menu button.

 

  • Click Add on the Bookmarks pane;
  • Right click on the bookmark then click Rename;
  • Rename this to the same name as the field it represents; and
  • Repeat these steps for any additional fields you may have. 

 

Setup the actions

Once you've added all your bookmarks to your Bookmarks pane we can move forward to loading the actions. The order of which

Watsky_9-1641500961789.png

you load first does not matter. I am starting with the Slicer icon.

  • On the Selection pane click the Slicer icon;
  • On the Format shape pane in the Shape group find the Action sub-group;
  • Click the on/off button to the right of Action. Then expand the Action sub-group; then
  • Set the type to Bookmark then select the Slicer Drop Down bookmark.

Follow these steps to set the action for each of your field objects till all are complete.

 

Test and publish

The entire setup is complete. Now it is time to test out the slicer.

  • Start by making sure nothing is selected on your slicer'
  • Hover your mouse over the menu icon. You should see a message which reads CTRL+click here to follow link;
  • As the instructions say hold down CTRL on your keyboard then left click on the icon. It should load your menu; and 

Watsky_10-1641501058046.png

  • Inside the menu you will still need to hold down CTRL+click to open it. Once you're satisfied with the product, save and publish the report. Now, test out your finished product.

 

Wrap-up

With this tutorial you learned how you can create a slicer selector to allow your users the freedom to select what type of slicer is available. Hopefully this is something that can be implemented in the future but until then I hope this helps.  Here are some ideas posted you can vote up so we can get this added.

 

Microsoft Idea  · Allow Users to Change Date Slicer Type (powerbi.com)

Microsoft Idea  · Allow date slicer type change without edit permission (powerbi.com)