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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
amshumansunkurd
Frequent Visitor

Disable one slicer when another slicer is not selected

I have 2 slicers , year and month.

 

I want to disable month slicer when no year slicer is selected. 

 

I tryed using below dax functions

 

1.  If(isfiltered(calendar[year]),1,0)

2.  Int(isfiltered(calendar[year]))

 

I added into filter on the visual section and for both I filtered with 1.

It is working

But my issue here is.

When I selected both Year and month and if I deselect the year , month selected will remain as it is. Need solution for this. 

 

3 REPLIES 3
amshumansunkurd
Frequent Visitor

I used both measures already. And currently I'm using reset slicer button. But still i want to see the solution for my issue. 

 

Thanks 

Anonymous
Not applicable
DataNinja777
Super User
Super User

Hi @amshumansunkurd ,

 

To address the issue where the Month slicer retains the selected month even after the Year slicer is deselected, you can use a DAX measure combined with a visual filter to dynamically enable or disable the Month slicer. Start by creating a measure to check if a year is selected. The measure can be written as follows:

EnableMonthSlicer = 
IF(
    ISFILTERED(Calendar[Year]),
    1, -- Enable the Month slicer when a Year is selected
    0  -- Disable the Month slicer when no Year is selected
)

This measure ensures that the Month slicer is only active when a year is selected. Once the measure is created, go to the Month slicer visual, drag the EnableMonthSlicer measure into the "Filters on this visual" section, and set the filter to show only values where the measure equals 1. This will prevent the Month slicer from being used when no year is selected.

If the issue persists where the selected month remains even after the Year slicer is deselected, you can extend the solution by ensuring that only valid months are shown when a year is selected. This can be done by creating a new calculated column or measure:

ValidMonth = 
IF(
    ISFILTERED(Calendar[Year]),
    1, -- Show valid months
    BLANK() -- Hide invalid months
)

This measure can also be added as a filter for the Month slicer, ensuring that only relevant months are displayed when a year is selected. Unfortunately, Power BI does not automatically clear a slicer's selection when its filter becomes invalid. To handle this limitation, you may consider adding a "Reset Filters" button or using Sync Slicers from the View tab in Power BI Desktop to synchronize the slicer behavior across multiple pages. These adjustments can help ensure a smoother user experience while maintaining the desired slicer functionality.

 

Best regards,

 

 

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors