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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
bmms
Helper I
Helper I

How to filter a slicer based on other slicers

Hello everybody,

 

I am not able to filter a slicer based on other slicers.

 

In my example, I have the year and month slicers (calendar table) where I show a summary of registrys (registry table) and errors (error table) by cost center.

 

In addiction, i have other Cost Center slicer (cost center table), but I can't get this slicer to only select cost center from the year and month that was previously selected.

 

I turned on the interaction of the slicer, but the problem continues!

 

1.JPG2.JPG3.JPG

 

4.JPG

 

How can I solve this problem?

 

You can download my example using the follow link:

 

https://we.tl/t-weNH8ySp25

 

Best regards.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write this measure

Count = COUNTROWS(Errors)+COUNTROWS(Registry)

Select the Cost Centre slicer and drag the measure to the filter pane.  Specify the criteria there as "Not blank".

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Write this measure

Count = COUNTROWS(Errors)+COUNTROWS(Registry)

Select the Cost Centre slicer and drag the measure to the filter pane.  Specify the criteria there as "Not blank".

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yueyunzh-msft
Community Support
Community Support

Hi , @bmms 

You can create a measure like this:

Slicer filter =

var _selectedvalue=SELECTEDVALUE('Cost Center'[Name])

var _filterednames=SELECTCOLUMNS(FILTER(ALL('Registry'),YEAR('Registry'[Date])=SELECTEDVALUE('CALENDAR'[Year])&&MONTH('Registry'[Date])=SELECTEDVALUE('CALENDAR'[Month])),"1",'Registry'[Cost Center])

return

IF(_selectedvalue in _filterednames,1,0)

 

Then you can place the newly created measure into the visual filter of this slicer "Cost Centere" name:

vyueyunzhmsft_0-1676601556938.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Hello,

 

thanks for your feedback.

 

Your solution almost works for me, but i have a special scenario.

 

With your solution, if i don't select any month (i want values from all months), in the slicer doesen't appear any cost center for selection.

 

1.JPG

 

How can i resolve this?

 

Best regards.

Hi , @bmms 

You cna try to use this dax to replace:

Slicer filter = 
var _selectedvalue=SELECTEDVALUE('Cost Center'[Name])
var _month= VALUES('CALENDAR'[Month])
var _filterednames=SELECTCOLUMNS(FILTER(ALL('Registry'),YEAR('Registry'[Date])=SELECTEDVALUE('CALENDAR'[Year])&&MONTH('Registry'[Date]) in _month),"1",'Registry'[Cost Center])
return
IF(_selectedvalue in _filterednames,1,0)

Then we can solve this issue:

vyueyunzhmsft_0-1676861709248.png

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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