Forum Discussion

am00's avatar
am00
New Member
1 year ago
Solved

Switch chart visibility based on filter selection

Hello everybody,

I have a dashboard with a main bar chart showing total amount drilled down by a specific dimension.

Then, on a separate part of the page, I have a detail section in which I would like to show a different detail chart based on whether the user has selected a single value in the main chart or not.

So, if the user selects a single value in the main chart, I would like to make DetailChart1 to be visible in the detail section.

Otherwise, if the user either does not select any value or selects mulitple values in the main chart, I would like to make DetailChart2 to be visible in the detail section.

 

I know visibility could be controlled using bookmarks, but as far as I know bookmark change must be triggered explicitly using buttons, whereas in my case I would like to switch the detail charts visibility based on the value selection in the main chart.

Is there a way to achieve this result?

 

Many thanks to everybody for the help,

Andrea

  • Hi am00 

     

    You can use a shape that sits on top of DetailChart1 and another one that sits on  top of DetailChart2. These visual objects are layered as follows Shape1 > DetailChart1 > Shape2 >DetailChart2 with the DetailChart2 on the very bottom. The shapes are conditionally formatted so the color fill blends with the background (could be white, depending on the canvas color) while the other is transparent and vice-versa based on whether a slicer returns a single value. Sample conditional formatting measure based on slicer selection:

    Shape1 fill =
    IF ( HASONEVALUE ( data[column] ), "white", "RGBA(0,0,0,0)" )
    
    Shape2 fill =
    IF ( HASONEVALUE ( data[column] ), "RGBA(0,0,0,0)", "white" )
    
    

     

    Please note that the shapes don't become  invisible (like they can be  with bookmarks) but simply blend with the background which also means that since they're sitting on top of the detail charts, details charts cannot be used to crossfilter the other visuals as what gets clicked are the shapes.

2 Replies

  • Hi am00 

     

    You can use a shape that sits on top of DetailChart1 and another one that sits on  top of DetailChart2. These visual objects are layered as follows Shape1 > DetailChart1 > Shape2 >DetailChart2 with the DetailChart2 on the very bottom. The shapes are conditionally formatted so the color fill blends with the background (could be white, depending on the canvas color) while the other is transparent and vice-versa based on whether a slicer returns a single value. Sample conditional formatting measure based on slicer selection:

    Shape1 fill =
    IF ( HASONEVALUE ( data[column] ), "white", "RGBA(0,0,0,0)" )
    
    Shape2 fill =
    IF ( HASONEVALUE ( data[column] ), "RGBA(0,0,0,0)", "white" )
    
    

     

    Please note that the shapes don't become  invisible (like they can be  with bookmarks) but simply blend with the background which also means that since they're sitting on top of the detail charts, details charts cannot be used to crossfilter the other visuals as what gets clicked are the shapes.