cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HassanAshas
Helper I
Helper I

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.