This summary is produced by the author, and not by AI.
Many reports include a month slicer, giving the user to filter their data to one or more months. Since the slicer is so important to the context of the report, it’s typically shown as tiles that work like buttons, present as a single row or column on the report page. However, the default slicer is too dark and has very limited formatting options. With the new button slicer and a few formatting changes, you can get much better results:
In this article, we show you step-by-step how to make a simple yet elegant button slicer for your Power BI report without custom visuals or complex hacks that are hard to maintain.
It’s very common in Power BI reports to include slicers excessively. Many reports can have their top section completely full of slicers, taking up valuable real estate that is better used by cards, KPIs, or just empty space for readability. Before you add your monthly slicer, you should also consider some alternatives, too:
These alternatives include:
In this scenario, though, a slicer might be preferable because:
We’ll proceed with the month slicer for now, but it’s important to know that alternatives may exist, and might be better for your situation.
The purpose of the slicer is to filter to a particular month (obviously). However, this particular design provides additional information to inform month selection. The intent isn't to “make the slicer look nice”, but to make selection more convenient:
The formatted provide some visual cues to better inform month selection. Without the formatting, the user selects a month based on either implicit guesswork or explicit information they get from other sources. You can see the improvement by comparing the difference, below:
The following section explains how to build this slicer. Please feel free to exclude or alter any of the formatting in any step, as you see fit.
To make this slicer, follow the below steps:
Step 1. Add a new button filter visual to the report page. If you don’t have the visual type available, then you need to enable the preview feature from Options and Settings > Preview Features.
Step 2. Add the month name field from your model. You might want to add an abbreviated version of month name (such as Jan instead of January) for readability. To sort the month name by month number, you have to use the Sort By… property in Power BI Desktop or Tabular Editor to sort the month name column by month number. Ensure that the month number column is an integer.
Step 3. Under Layout, set the layout of a grid to 1 row of 12 columns. Resize the visual to the appropriate space.
Step 4. Apply a theme if you have one to set any container or specific formatting. If you’d rather not apply the theme, you can make the below formatting changes to match our example. Feel free to deviate and experiment, as you want.
#FFFFFF (white) and 50% transparency, and disable the border. Enable the accent bar and set it to 4px.Step 5. Apply conditional formatting.
#DADADA). Again, try to use theme colors, like midColor. For more information about using theme colors in DAX and why this saves you time and headache, read this article.The reason we use a measure rather than format with the user interface is because if we want to change the colors, we can do so in the theme. Also, if we want to change the formatting logic, we can do so in the measure. These are more efficient approaches that save us time in the future when we want to make a change. For instance, in this example, we use the same measure in four different places of the visual. It’s much faster to change one measure than going insane clicking through Power BI’s billion bloody menus to change the formatting, manually. Feel free to deviate from this, though, if you prefer.Also, remember that conditional formatting increases the query complexity of your visual. Basically, more conditional formatting will result in slower visuals. Only format what you need to; keep it simple! Especially for larger data.
Step 6. Optionally, we can optionally add a Callout Value Label. This could be the actual value, or the comparison in percentage. Unfortunately, we have limited formatting options for this value, but we can at least ensure that it is appropriately rounded and sized so it is readable without providing too much cognitive overload. This produces the final visual. Note that in this example future months show (Blank); you might want to handle that case in a new conditional formatting measure if you want:
Step 7. Optionally, you can specify an SVG in a DAX measure to provide a small visualization or a custom icon. However, for a month slicer, we don’t recommend this. For most cases, it makes the report harder to maintain and change over time. Instead, you might consider something like a custom report page tooltip that shows the trend for the entire year.
When adjusting this design for your own purposes, consider the following:
theme.json file. This will ensure that all your future button slicers look the same, which is convenient.It’s a common pattern to include a month slicer on your report. You don’t need to include a month slicer; in fact, some scenarios might be better without it entirely. If you do need it, then you can consider applying some conditional formatting to make it more useful and convenient for your users.
Take your semantic models further with Tabular Editor.
Give Tabular Editor a spin