Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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%20Conditional%20formatting%2C%20Select,The%20visual%20to%20show%2Fhide

 

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. 

 

 

  • 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.

4 Replies

  • 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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      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?