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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
dataandme
Regular Visitor

Hide/unhide Gauge Chart when a particular value is selected in the Slicer

Hi,
I was using the below DAX to hide a visual when the value A is being selected on the Product Category Slicer. It is working well for a KPI chart, but for some reason its greyed out a Gauge Chart when I try to use this measure as a visual filter. Any thoughts why? or any alternative solution?

Hide Visual = IF(SELECTEDVALUE('Product'[Category])="A",1,0)

Thanks in advance.

5 REPLIES 5
qqqqqwwwweeerrr
Super User
Super User

Hi @dataandme 

 

When you greyed out means it title is not hiding?
i am trying to replicate the same what you are trying here is my approach i have created the two measure here are those

Hide Pie chart = IF(SELECTEDVALUE('Sales Super Store Data'[Category]) in { "Furniture","Technology"},0,1)
tittle = IF(HASONEFILTER('Sales Super Store Data'[Category]),"Sale by Segemnt","")
 
So when if "Furniture" or "Technology" is selected the my one of chart will be hidden say pier chart, if office suplies is selecetd than pie char will hide is that similar you are trying?
qqqqqwwwweeerrr_0-1712763503341.png

now if i selecetd other than offcie suplies 

qqqqqwwwweeerrr_1-1712763564248.png

Let me know if approach differ or this does not solves your issue 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: https://www.youtube.com/@letssolveproblem

Regards

Hi @qqqqqwwwweeerrr 
Thank you so much for the message. Your approach is same like I did. The issue Im having is that, when I drop the measure(called Hide Visual) into the filters pane, Im unable to set it to 0 to be able to hide it when the value="A" is selected in the slicer. The option "is less than" is frozen and neither im able to put any value in the box below it. Something that's really strange is that its working well with a KPI chart and the issue is happening only with the Guage Chart. 

It would be good to know your thoughts on this. 🙂 

Thank you

 
 

unnamed.png

Hi @dataandme 

 

try to restart again power bi coz logic wise your are correct. It happens sometimes or you can try other way around put this hide condition on KPI chart instead  of gauge chart that might also slove the issue 

 

Regards

talespin
Solution Sage
Solution Sage

hi @dataandme 

 

Use a shape and bring it on top, your visual should be under it.

 

Now set the shape color to transparent(#FFFFFF00) or white(#FFFFFF) based on your condition.

 

 

Hi @talespin 
Thankyou for the suggestion, but unfortunately my aim is to replce that visual with another chart when it goes blank.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors