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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pantherfanrh
Frequent Visitor

Best way to change slicer values

Hi all, I was wondering what the best way to remove values from a column in a slicer would be? For instance

 

I have a column 'Year', which has the values from 1999-2017 in it. I only want the slicer able to select years in the range of 2010-2017. What would be the best way to do this?

1 ACCEPTED SOLUTION
prateekraina
Memorable Member
Memorable Member

Hi @pantherfanrh,

 

As suggested by other users as well, you cannot add visual level filter for slicers. However, i have a crazy workaround for you.
Here it goes:

1. Create a calculated column with below dax

Slicer1 = IF(DimDate[Year] >= 2010,DimDate[Year],BLANK())

2. Create a slicer and put this column in that, you will see something like below (for you values will be between 2010 - 2017): 
Solution1.PNG
Now half the problem is solved. We just need to get rid of (Blank).

3. Create another calculated column on top of previously created column using below DAX:

Slicer2 = DimDate[Slicer1] >= 2010

Create another slicer and put Slicer2 in that. 
You will notice that it has 3 values: a) Blank b) False c) True

4. Go to Edit Interactions and make sure Slicer 2 does not filter your visuals other than Slicer 1.
5. Choose True in Slicer 2, it will leave what you need in Slicer 1.
6. So now you have what you wanted in Slicer 1, the only problem now you have to figure out is to hide Slicer 2, change its font color to white, Header - OFF.

I hope you will be good to go from here.


Thanks !!

View solution in original post

3 REPLIES 3
prateekraina
Memorable Member
Memorable Member

Hi @pantherfanrh,

 

As suggested by other users as well, you cannot add visual level filter for slicers. However, i have a crazy workaround for you.
Here it goes:

1. Create a calculated column with below dax

Slicer1 = IF(DimDate[Year] >= 2010,DimDate[Year],BLANK())

2. Create a slicer and put this column in that, you will see something like below (for you values will be between 2010 - 2017): 
Solution1.PNG
Now half the problem is solved. We just need to get rid of (Blank).

3. Create another calculated column on top of previously created column using below DAX:

Slicer2 = DimDate[Slicer1] >= 2010

Create another slicer and put Slicer2 in that. 
You will notice that it has 3 values: a) Blank b) False c) True

4. Go to Edit Interactions and make sure Slicer 2 does not filter your visuals other than Slicer 1.
5. Choose True in Slicer 2, it will leave what you need in Slicer 1.
6. So now you have what you wanted in Slicer 1, the only problem now you have to figure out is to hide Slicer 2, change its font color to white, Header - OFF.

I hope you will be good to go from here.


Thanks !!

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @pantherfanrh,

 

As we cannot add visual level filter for the Slicers currently, you can add a report/page level filter for the 'Year' column in this scenario.

 

 

For more details about how to add a filter to Power BI Report, you can refer to this article. Smiley Happy

 

Regards

Greg_Deckler
Super User
Super User

You could simply set a visual level filter to be greater than 2009



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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