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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AndrewLGoldman
Advocate I
Advocate I

Year Filter on Filters Pane Requiring Single Selection Disables Single Selection If User Deselects

Hey Power BI Community,

 

Not sure if anyone else ran into this or has any ideas, but I would be so grateful if anyone had any ideas!  Right now on one of my Power BI Desktop reports I have a filter that enables you to filter by year as follows on the filter pane (note: not a slicer, this is intentional, unfortunately a slicer is not an option for me at this time):

 

Year Filter on Filter Pane.png 

 

and this works amazingly well and truly only allows a user to select 1 year at a time!  But unfortunately if a user selects the same year again/deselects the same year (de-selecting 2020 in the example above), the data set then filters for all years (as expected I guess!)  But that's unfortunately the rub for me - if a user has no year selected, I would want no data to show instead of all of the data such that a user can either show no data or only 1 year's worth of data, or even to not be able to unselect a year and always be forced to pick 1 year from the options -- does anyone know if anything like this might be possible or if there might be any work arounds?  Something perhaps similar to a radio button list instead of a picklist for the filter's pane!  Again, unfortunately a visual slicer is not a workable solution for me at this time, but I appreciate any advice!

 

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AndrewLGoldman ,

 

Are you mean you want years can't be multi-selected but months can be?

Measure = IF(CALCULATE(DISTINCTCOUNT('Table'[yearmonth].[Year]),ALLSELECTED('Table'))>1,BLANK(),1)

9.PNG

10.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @AndrewLGoldman ,

 

Thanks @MFelix  to give the direction.

I modified the formula and used ALLSELECTED() function.

Here's the formula i used and the result as below. 

 

Measure = IF(CALCULATE(DISTINCTCOUNT('Table'[year]),ALLSELECTED('Table'))>1,BLANK(),1)

 

What we need to do is adding this measure to visual level filter.

1.PNG

2.PNG

3.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @Anonymous  @MFelix - those are great ideas for blank-ing out the data in the data tables!  Works like a charm!  Nice save for some of the data tables

 

Would either of you maybe have any ideas for charts as well?  For example, a simple bar chart with MM-YYYY on the axis and some value as the value -- when a user deselects a year and let's say there's 5 years worth of data (e.g. 2016 - 2020), the bar chart expands horizontally exponentially with 60 columns when I rather just show 1 year's worth of months or even better no data or axis at all as opposed to every month between the first year and last year in the data set


I guess I could show just the month name but I find it's much more visually appealing to keep it in the MM-YYYY format

 

Any ideas?

Thanks again for the really good idea above though, that's great!

Anonymous
Not applicable

Hi @AndrewLGoldman ,

 

Are you mean you want years can't be multi-selected but months can be?

Measure = IF(CALCULATE(DISTINCTCOUNT('Table'[yearmonth].[Year]),ALLSELECTED('Table'))>1,BLANK(),1)

9.PNG

10.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Apologies for the delay in response!  I can see how that solution would definitely work, but I actually had a standard date column I set custom formatting to be in the style of "mm yyyy" and enabling 1 slicer instead of 2 without drill up/downable functionality

MFelix
Super User
Super User

Hi @AndrewLGoldman ,

 

A possible workaround and depeding on your visualizations is on your measures make a similar sintax to this one:

 

Measure =  IF(DISTINCTCOUNT(Table{Year]) > 1 , BLANK(); [Measure]))

 

This will blank out your data, but again depends on how you have your data setup.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.