cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jeffery24 Regular Visitor
Regular Visitor

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.

 

 

Capture.JPGCapture2.JPG 

 

 

 

 

 

 

 

 

 

 

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

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Stachu Super Contributor
Super Contributor

Re: Dynamic slicer based on drop down list

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

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
v-jiascu-msft Super Contributor
Super Contributor

Re: Dynamic slicer based on drop down list

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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jeffery24 Regular Visitor
Regular Visitor

Re: Dynamic slicer based on drop down list

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 Super Contributor
Super Contributor

Re: Dynamic slicer based on drop down list

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

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Jeffery24 Regular Visitor
Regular Visitor

Re: Dynamic slicer based on drop down list

Hi Stachu,

 

Thanks for the idea will give that a go.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 443 members 4,314 guests
Please welcome our newest community members: