Forum Discussion

Jeffery24's avatar
Jeffery24
Helper I
8 years ago
Solved

Dynamic slicer based on drop down list

Hi,

 

I am new to Power BI and was wondering if it is possible to create a dynamic slicer based a drop down menu.

Reason being is that I am running out of dashboard space when adding slicers.

The slicer selection in the options would determine the control for the main slicers.

 

 

 

 

 

 

 

 

 

 

 

 

 

I have done something similar with a dynamic measure but that was adding values to a graph.

Thanks in advance.

  • Stachu's avatar
    Stachu
    8 years ago

    Slicer wise I think you could achieve that with table grouping the 2 dimensions

     

    Slicer One OptionsSlicer One
    CarrierA
    CarrierB
    CarrierC
    POLChina
    POLPakistan
    POLSpain
    PODAustralia
    PODNZ
    PODRwanda

    the issue is that most likely you will need to pass the filter from the slicer manually to the measures - unless you could pass the joins in a way to propagete filters to multiple columns

4 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Jeffery24,

     

    Yes, when we select options in one slicer the other one will be filtered if these two fields have connections. It seems what you need. What's the issue? Can you share a sample?

     

     

    Best Regards,

    Dale

    • Jeffery24's avatar
      Jeffery24
      Helper I

      Hi Dale,

       

      Thanks for reply.

      I can't share the dashboard due to our companys data policy but will try to explain what I want to achieve.

       

      I have 2 tables one main table containing freight movement data i.e. a container coming from China to Germany containing 5,000 pcs and 60 cubic metres etc. The table"SP Data" contains different headers e.g. POL (origin port) / POD (destination port) / Carrier (company who owns the container ships). The data file could contain from 500 to 5000 rows dependant on customer report

      --tried to attach a screen print but is different option then when posting!----

       

      Currently for each  header I have a slicer that lists all the aggregated POLs / PODs / Carriers. The customer has asked for more headers to be used as slicers to drill into the data. This is fine but eats up dashboard space/

       

      My thoughts were to use a measure and a seperated static table called "Table"  listing the names POL / POD / Carrier under and "options" field.

      Then use the switch option to change the slicer source dynamically.

       

      The code is not expected to work but I wondered if there was a string equivalent of the below to allow the output the Table to be the source of "Slicer One" which could dynamically populate the slicer based on the users choice. Hope this makes sense.

      Thanks.

       

       Slicer One =
      IF(HASONEVALUE( 'Table'[Report][Option]), SWITCH(VALUES( 'Table'[Report][Option]), "POL", GROUPBY( 'SP DATA'[POL]), "POD", groupby( 'SP DATA'[POL]), "Carrier", groupby( 'SP DATA'[Carrier])), "Missing")
      • Stachu's avatar
        Stachu
        Community Champion

        Slicer wise I think you could achieve that with table grouping the 2 dimensions

         

        Slicer One OptionsSlicer One
        CarrierA
        CarrierB
        CarrierC
        POLChina
        POLPakistan
        POLSpain
        PODAustralia
        PODNZ
        PODRwanda

        the issue is that most likely you will need to pass the filter from the slicer manually to the measures - unless you could pass the joins in a way to propagete filters to multiple columns