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! Request now

Reply
SmithSC
Regular Visitor

How to hide a visual using a slicer

I have a power bi table which contains 4 category columns and a count measure. My power bi page contains 3 dropdown slicers (Category1, Category 2 and Category 3) and 4 column charts.

 

I am trying to hide charts based on the selection of 3 slicers (Category 1, Category 2, Category3). If none of the slicers are selected  then I want Category 1 column chart to show. If a selection is made in the first slicer then I want Category 2 chart to show.

 

To do this, I created 3 measures to test the slicers:

Cat1 Test = IF(ISFILTERED(Data[Category 1]),1,0)
Cat2 Test = IF(ISFILTERED(Data[Category 2]),10,0)
Cat3 Test = IF(ISFILTERED(Data[Category 3]),100,0)
 
I've then created another measure to add the 3 previous together.
Total Test = [Cat1 Test] + [Cat2 Test] + [Cat3 Test]
 
Then another measure works out which chart to show:
See Visual =
    SWITCH(
        TRUE(),
        [Total Test] = 0, "Cat1", -- Show Category 1 Chart
        [Total Test] = 1, "Cat2", -- Show Category 2 Chart
        [Total Test] in {10,11},"Cat3", --Show Category 3 Chart
        [Total Test] in {100,101,110,111},"Cat4", -- Show Category 4 Chart
        BLANK()
    )
 
Finally I put this last measure in the visual filter and selected "is Cat1". This doesn't seem to work and just hides the report.
 
Has anyone any idea what I've done wrong.
 
Many thanks in advance for any help given.
0 REPLIES 0

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