Forum Discussion

mr_yogi's avatar
mr_yogi
Frequent Visitor
3 years ago
Solved

Master - Slave Filter/ Slicer in Power BI

Hi,

 

I have a multi-page dashboard which compares metrics across 6 countries, with about half the pages comparing the 6 countries directly and the rest having a slicer to select 1 of the 6 in more detail. The limit of 6 countries was to keep the visualisations clean and readable.

 

I now need to incorporate more countries, however there is no need to compare more than 6 at a time, thus the easiest way I could think of would be to include a master slicer on the front page that allowed the user to select their chosen (up to 6) countries. Unfortunately, every attempt I’ve made hasn’t worked out.

 

Is this even possible? I can sync slicers, but not limit the available options for the secondary slicer based on the primary, I also thought about using measures to somehow populate the secondary slicer but can’t work out how to then connect that back to the data.

 

Thanks

 

  • mr_yogi Maybe create a disconnected table for your master slicer. Then create a measure that you use to filter your secondary slicers like:

    Selector = 
      VAR __MasterCountries = SELECTCOLUMNS( 'MasterSlicer', "Country", [Country] )
      VAR __Country = MAX('CountrySlicer'[Country])
      VAR __Result = IF( __Country IN __MasterCountries, 1, 0)
    RETURN
      __Result

    Use the Filters pane to filter your secondary slicers where this measure = 1

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    mr_yogi Maybe create a disconnected table for your master slicer. Then create a measure that you use to filter your secondary slicers like:

    Selector = 
      VAR __MasterCountries = SELECTCOLUMNS( 'MasterSlicer', "Country", [Country] )
      VAR __Country = MAX('CountrySlicer'[Country])
      VAR __Result = IF( __Country IN __MasterCountries, 1, 0)
    RETURN
      __Result

    Use the Filters pane to filter your secondary slicers where this measure = 1