Forum Discussion
LED_General
10 months agoAdvocate I
Button Slicer - State disabled
Hi folks, as of my understanding, the button slicer used with month names has the option of greying out buttons, that don't appear yet (e.g. in my example the months october to december for the year...
- 9 months ago
For fellow travellers out there:
Greyed out categories are now possible in the button slicer since the october Power BI update (Power BI October 2025 Feature Summary | Microsoft Power BI-Blog | Microsoft Power BI).
Therefore I have a solution since today!
Thanks v-nmadadi-msft srlabhe and MasonMA for the contributions!
srlabhe
10 months agoSuper User
Kindly try below altenative workaround for same 🙂
in Power BI, the most effective way to grey out and disable future month buttons in a slicer is to use a filter based on a DAX measure, not by attempting to disable the visual's buttons directly. The standard Button Slicer visual does not have an option to disable specific items.
Here is the step-by-step method to achieve this effect:
Step 1: Create a calendar or date table
First, you need a dedicated date table for your report. If you do not have one, you can create one using DAX.
dax
Date Table = CALENDAR(MIN(YourFactTable[Date]), TODAY())This formula generates a calendar that goes from the earliest date in your data up to the current date, which automatically excludes all future dates. You can also expand this table with columns for the month and year.
Step 2: Create a measure to identify past and present months
You will need a measure that evaluates whether a month and year are in the past or present. In your date table, add a new calculated column for the month and year, for example, Year_Month_Text.
dax
Year_Month_Text = FORMAT('Date Table'[Date], "yyyy-mm")Next, create a DAX measure to act as your filter.
dax
IsPastOrCurrentMonth =
VAR LastMonthInDataset = MAXX(ALL('Date Table'), 'Date Table'[Date])
RETURN
IF(
MAX('Date Table'[Date]) <= LastMonthInDataset,
1,
0
)This measure checks if the month is less than or equal to the last month with data, which effectively prevents selecting future months.
Step 3: Apply the measure to the slicer visual
Use the measure created in the previous step to control what is displayed in the slicer.
- Add your Year_Month_Text column to a Slicer visual.
- Drag your IsPastOrCurrentMonth measure into the "Filters on this visual" section of the filter pane for that slicer.
- Set the filter condition to "is equal to 1" and click "Apply filter."
Step 4: Add conditional formatting for the greyed-out appearance
To achieve the greyed-out appearance, you can use conditional formatting on the button's background and font color.
- Create a measure that returns a specific color for future dates.
dax
FutureMonthColor =
IF(
MONTH(MAX('Date Table'[Date])) > MONTH(TODAY()) || YEAR(MAX('Date Table'[Date])) > YEAR(TODAY()),
"#D3D3D3", // Light grey for disabled buttons
"#FFFFFF" // White for active buttons
)- Select your slicer, go to the Format your visual pane, and expand the Buttons section.
- For State, choose the "Disabled" state.
- For Fill or Font color, select the conditional formatting option (fx) and apply the FutureMonthColor measure.
This technique uses a DAX filter and conditional formatting to simulate disabled buttons. This will visually indicate which months are selectable and automatically prevent future months from being chosen.
- LED_General10 months agoAdvocate I
Thank you very much for your detailed answer! I'm quite sure this workaround could do the trick.
However at the Fabcon 2025 in Vienna an official solution with the button slicer was presented and I am trying to achieve that.- MasonMA10 months agoSuper User
Can you share the slide used at Fabcon that shows this feature?
- LED_General10 months agoAdvocate I
I'll see if I can find it somewhere.