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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SJB30
New Member

Unfilter date slicer when 'Year' is selected from another parameter slicer

I have a parameter set up with 'Month', 'Quarter' and 'Year' which is then used on all my visual axis so that the user can switch between these views via a slicer. I also have a date slicer where the user can select a date range. I want the date range to be disabled or unfiltered only when 'Year' is selected in the parameter slicer so that all years are displayed on the visuals rather than just the one that falls within the date range.

 

Thanks for your help!

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @SJB30 ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
grazitti_sapna
Super User
Super User

Hi @SJB30 , 

Solution: Use a DAX Measure to Control Filtering
We can create a measure that dynamically adjusts filtering based on the selected parameter:

Date Filtered =
VAR SelectedView = SELECTEDVALUE( 'Parameter Table'[View] ) -- Month, Quarter, Year
RETURN
IF( SelectedView = "Year",
1, -- Show all dates when "Year" is selected
IF( MAX( 'Date Table'[Date] ) IN VALUES( 'Date Table'[Date] ), 1, 0 ) -- Apply the slicer filter
)

Steps to Implement:
1️⃣ Create a parameter table for Month, Quarter, and Year
2️⃣ Add a slicer using this table
3️⃣ Apply the Date Filtered measure as a visual-level filter on the visuals where you want the behavior to apply

  • Set the filter condition to "is 1"

Why This Works:

Keeps the date slicer functional when "Month" or "Quarter" is selected
Ignores the date slicer when "Year" is selected
Simple and no need for complex interactions or bookmarks

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

Thanks! I have followed your instructions but it's not working. When I put the filter measure into a card Year still comes out as 1 so it;s not ignoring the date slicer:

 

Date Filtered =
VAR SelectedView = SELECTEDVALUE( 'Date Axis'[View Name] ) -- Month, Quarter, Year
RETURN
IF( SelectedView = "Year",
1, -- Show all dates when "Year" is selected
IF( MAX( Date_Table[Date] ) IN VALUES( Date_Table[Date] ), 1, 0 ) -- Apply the slicer filter
)

Hi @SJB30 ,

It looks like the measure is still being influenced by the date slicer. Instead of relying on MAX(Date_Table[Date]), let's modify the approach to completely ignore the date slicer when "Year" is selected using ALLSELECTED().

Updated DAX Measure:

Date Filtered =
VAR SelectedView = SELECTEDVALUE( 'Date Axis'[View Name] ) -- Month, Quarter, Year
RETURN
IF(
SelectedView = "Year",
1, -- Show all data, ignore the date slicer
IF(
MAX( Date_Table[Date] ) IN ALLSELECTED( Date_Table[Date] ),
1,
0
)
)

Key Changes & Why It Works:

✔️ ALLSELECTED(Date_Table[Date]) ensures the measure considers all selected dates without breaking context.
✔️ Ignores the date slicer when "Year" is selected, but still applies it when "Month" or "Quarter" is chosen.
✔️ Can be used as a visual-level filter → Set it to "is 1" in your visuals.

Next Steps:
1️⃣ Try applying this measure as a visual-level filter on the visuals where filtering needs to be controlled.
2️⃣ Check if the parameter slicer is correctly passing values (Month, Quarter, Year).
3️⃣ If issues persist, test with a table visual showing Date_Table[Date] to ensure it's returning all dates when "Year" is selected.

Let me know if you need further debugging! 🚀

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.