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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HassanAshas
Helper V
Helper V

Problem in Displaying/Hiding Visual based upon a Slicer value, using Measure

I have a problem where I have to hide a visual and show another visual based upon Slicer Selection. I followed this tutorial: https://exceleratorbi.com.au/show-or-hide-a-power-bi-visual-based-on-selection/#:~:text=Click%20on%2...

 

My problem is, 

  1. I have a slicer for Capacity.
  2. If a user Selects "All" Capacity, then it should show a Bar Graph with Capacity on X-Axis
  3. If a user selects any particular capacity, then the bar graph shown should have Operation on X-axis

To solve this issue, I created two Bar Graphs. I created a Measure that checks whether capacity is filtered or not, 

 

 

Is Capacity Selected = 
    IF(
        ISFILTERED('Main Sheet'[Capacity]), 
        1, 
        2
    )

 

 

And added this to both Graph Visual Filters. 

 

The problem I am facing is when I select 2, the Bar Graph with Operation at X-Axis disappears (as expected), but the bar graph with Capacity at X-Axis does not show. I also added a card to check the value of Measure and it's also 2, which means that the bar graph with Capacity at X-Axis should show when I select "All" from the Capacity Filter. 

 

Even more interestingly, if I change the X-Axis to any attribute other than Capacity, then this bar graph works totally fine. 

 

Can anyone help me out in this? How can I show the Visual of Bar Graph containing Capacity at X-Axis, whenever "All" is selected from Capacity Slicer.

 

Here's the Power BI Workbook that you can download and use: https://drive.google.com/file/d/1T8YAYZ8spOLKlA9HLE1coN17mnDyTA1w/view?usp=sharing

 

I also uploaded a small video on Youtube showing the expected behavior of what I am doing and where is it causing the problem, 

https://youtu.be/1-teUkPKZ8Q

As you can see, when using BillingPool (any attribute other than Capacity), I get the expected Results. But as soon as I select Capacity on X-Axis, the same behavior doesn't happen. 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

This will create a bad UX as the masking visual is preventing the user from interacting with the visual that is "under" it.  Use bookmarks instead.

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

This will create a bad UX as the masking visual is preventing the user from interacting with the visual that is "under" it.  Use bookmarks instead.

@lbendlin Thank you for the reply! I understand what you are saying. Can you guide me in how can I use bookmarks in this scenario? I don't want to use a button because I don't want user to specifically click on button to change the visuals.

 

Is if possible to somehow shift between two bookmarks using the Measure value? 

Not currently possible. If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.powerbi.com

Alright! Thank you. I will do that! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors