Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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!
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
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
✅ 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:
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
72 | |
62 | |
51 | |
48 |
User | Count |
---|---|
206 | |
90 | |
61 | |
59 | |
57 |