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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ABridgeA4
New Member

Hiding Visuals in PowerBI Based on Filter - Help!

Hi, I have a visual that I am attempting to hide based on if the user is filtering by a given category. I have had success using this technique on other visuals before, but for some reason this one will not work. I am using a measure called HideClassification with the value of 

HideClassification = if(ISFILTERED(Latest[Classification Test]),0,1)
Attempting to filter my bar chart by this measure with "Show items when value is 1" disappears my visual entirely even when it is not filtered and the value of HideFiltered is 1.
Additionally, I have a pie graph that I am attempting to hide with the same measure that just will not let me adjust the filter values at all and are grayed out as if they are locked.
Can someone please help me with this issue?
1 ACCEPTED SOLUTION
johnbasha33
Super User
Super User

@ABridgeA4 
Hi, Your issue likely stems from the way ISFILTERED() interacts with filters and the specific structure of your dataset. Here’s how to troubleshoot and fix it:

Your visual disappears entirely because ISFILTERED() is returning FALSE, setting the measure to 1, and your visual is hidden.

Alternative Approach Using CALCULATE

Instead of ISFILTERED(), try using ALLSELECTED() to detect if any category is actively filtered:

HideClassification =
IF (
COUNTROWS(ALLSELECTED(Latest[Classification Test])) = COUNTROWS(ALL(Latest[Classification Test])),
1, -- Show visual when nothing is filtered
0 -- Hide visual when filtered
)

  • Replace ISFILTERED() with COUNTROWS(ALLSELECTED(...)) method.

  • Apply the measure as a filter to your visuals.

  • Ensure the measure is correctly added to the visual if filtering options are disabled.

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



 

View solution in original post

2 REPLIES 2
johnbasha33
Super User
Super User

@ABridgeA4 
Hi, Your issue likely stems from the way ISFILTERED() interacts with filters and the specific structure of your dataset. Here’s how to troubleshoot and fix it:

Your visual disappears entirely because ISFILTERED() is returning FALSE, setting the measure to 1, and your visual is hidden.

Alternative Approach Using CALCULATE

Instead of ISFILTERED(), try using ALLSELECTED() to detect if any category is actively filtered:

HideClassification =
IF (
COUNTROWS(ALLSELECTED(Latest[Classification Test])) = COUNTROWS(ALL(Latest[Classification Test])),
1, -- Show visual when nothing is filtered
0 -- Hide visual when filtered
)

  • Replace ISFILTERED() with COUNTROWS(ALLSELECTED(...)) method.

  • Apply the measure as a filter to your visuals.

  • Ensure the measure is correctly added to the visual if filtering options are disabled.

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



 

Thank you so much, that works! Do you have any idea on how to resolve the other issue where I cannot change what the pie chart is filtered by? The filter is definitely not locked, so I am not sure what the issue is there.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.