Forum Discussion

jjjtr945's avatar
jjjtr945
Frequent Visitor
3 years ago

Change Table Visual Based on Slicer Selection

Hi,

 

I am looking to have a slicer that changes the table shown on my report. 

 

For example, when A is selected I want data A to show, B shows data B, C shows data C, etc... All data is in its own table. Is there a way to switch out which table is shown? My plan is to have each data in its own table visual and have them all on the report so that I can hide certain tables when necessary.

 

I have been looking into making all the other tables transparent when a slicer selection is selected (therefore just that table is shown). I am having dificulty trying to make the DAX measures for this. Would anyone be able to offer some guidance?

3 Replies

  • Hey jjjtr945 ,

    I have a basic question: Your slicer enables users to switch between A, B, and C. Are there any other options they can select?

    If not the easiest way would be that you duplicate the pages so that you have three pages in the end. Each page with the table which just contains values of A, B, or C. 

    Instead of the slicer you then add a page navigation and hide the pages. So if users select the button for B they will be forwarded to page B where they see the table with B data only. 

    Another method would be to use bookmarks, create three tables and hide/unhide the tables depending on the selected bookmark. However, if you don't have any other data displayed on the page I would not go for the bookmark selection. 

    Let me know if this is already helpful and which option you prefer more. I can give you more details as well to each solution. 

    • jjjtr945's avatar
      jjjtr945
      Frequent Visitor

       iceparrot I have considered using different pages but for my purpose I would prefer to have it all on one page.

       

      Would you be able to give more details for each solution? Thank you!

  • Hi jjjtr945 , 

    sure, so I'll give you an overview on each solution. 

     

    Let's start with the bookmarks solution:

    1. Create your Tables and place them on your report page. In case that they will be placed in the same place just place them over each other

     

    2. Enable the Selection & Bookmarks pane. You can do this by selecting View and then Selection and Bookmark in the top navigation

     

    You can see the aditional Selection pane on the right hand side now. It shows you all elements on your report page. Also our three Tables (Table A, Table B and Table C) which I already placed.

     

    3. Hide Table B and Table C and keep Table A visible.

     

    4. In the Bookmarks pane select Add and create a new bookmark. You can rename it how you like. I named it Table_A_bm

     

    5. Now hide Table A and unhide Table B and create another Bookmark

    6. Hide Table A and Table B and unhide Table C and create another Bookmark

    If you now click on the bookmarks you can already see that the different tables will appear and disappear. 

     

    7. Add Buttons to select your tables. Go to Insert Buttons in the top navigation and select a Blank Button

     

    8. Select the button and edit it in the Format pane on the right. 
    Set the Title and enable Actions

    As Action Type select Bookmark and as Bookmark the bookmark which should be triggered when clicking the Button

     

    If you now klick on the Buttons (keep CTRL pressed in Power BI Desktop) you can swith between your tables

     

     

     

    Keep in mind, that if you're using filters/slicers on this page as well they might be reset every time you select a bookmark to the state they were, when the bookmark was created at. 

    To sovle this issue follow the next steps:

     

    a) Select one of the bookmarks

    b) Select all visuals on the report page by selecting them in the Selection pane (also the hidden ones) except the slicers

     

    c) Keep the table selected and click on the three dots (...) in the bookmarks pane. Change the selection to Selected Visuals and then click Update

     

     

     

    Solution with different Pages

    If you want to display the tables on a separate page each follow the next steps:

     

    1. Create a new report page for each table or duplicate the existing page by right clicking on the page tab on the bottom of Power BI Desktop
    Note: I do not recommend this if you have a huge dashboard as you'll have to replicate all changes on every page again. If you just have a few elements there go for it.

     

    2. Insert your table on the Page

     

    3. Insert a Button (see step 7 above) 

     

    4. Enable the Action and set the Type to Page navigation. As Destination select your created page with Table B on it. 

     

    That's it. Repeat it for Table C

     

     

    There is also an option to insert Page and Bookmark navigators but you cannot style them as you'd like so they might not fit your report design. But if you want to try it click on Insert  > Buttons > Navigator and then either select Page Navigator  or Bookmark Navigator. 

     

    I hope this answers your question. Let me know if you need any further help and I'd be greatfull if you can mark it as solution if it fits your needs, to also help others.