cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yuching_chang
Helper II
Helper II

Filter a report using query string parameters in the URL with single select slicer

Hi there

 

I have a PowerBI dashboard (connection: Analysis Services) embedded in a web and we want to build URL to pass down parameters into PowerBI - so when users filter something in the web and link to PowerBI, the filtered parameters are passed down to PowerBI.

 

I've followed the instruction here: https://docs.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

 

Because we still need to allow users to filter in PowerBI, I need to build slicers in the dashboard. Then i found if today the slicer is Single Select, it goes wrong, but if Multi Select, it goes right...

 

For example - I have 2 slicers, L1 Location is Single Select while L2 Location is Multi Select

Firstly, I apply the query string to my URL to only pass parameter L2 Location = Location A2, and it works as below

https://mypowerbiserver/mypowerbifolder/mypowerbiname/?rs:embed=True&filter=Sheet1/L2_x0020_Location eq 'Location A2'

Capture1.PNG

 

Then, I tried to apply the query string to my URL to only pass parameter L1 Location = Location B, but it doesn't work...

The slicer shows the option of "Location B", but it still selects Location A, and no data is displayed

https://mypowerbiserver/mypowerbifolder/mypowerbiname/?rs:embed=True&filter=Sheet1/L1_x0020_Location eq 'Location B'

Capture4.PNG

 

Lastly, I tried to change slicer Location 1 to be Multi Select, and applied query string to both slicers, it works

So I guess it's because of Single Select...and would like to know if any way to fix this...? Thanks!

https://mypowerbiserver/mypowerbifolder/mypowerbiname/?rs:embed=True&filter=Sheet1/L1_x0020_Location eq 'Location B' and Sheet1/L2_x0020_Location eq 'Location B2'

Capture3.PNG

1 ACCEPTED SOLUTION
yuching_chang
Helper II
Helper II

hi @d_gosbell 

 

thanks for the reply, after several attempts, I found the workaround to use Hierarchy Slicer from marketplace and make it as Singel Select. It works, just the drawback is we can't have the slicer in the format of dropdown list, but still it helps 😉

View solution in original post

2 REPLIES 2
yuching_chang
Helper II
Helper II

hi @d_gosbell 

 

thanks for the reply, after several attempts, I found the workaround to use Hierarchy Slicer from marketplace and make it as Singel Select. It works, just the drawback is we can't have the slicer in the format of dropdown list, but still it helps 😉

View solution in original post

d_gosbell
Super User II
Super User II

Unfortunately there is no easy fix for this.

 

Url filters do not change slicers, they work by adding a report level (all pages) filter.

 

So when you change your slicer to a single select you are forced to save your report with a default value selected (eg L! Location = Location A). Then when you apply a url filter it adds a new "all pages" filter in the filter pane and if you select L1 Location = 'Location B' for example you now have the scenario where the filter condition is now  L1 Location = 'Location A' AND L1 Location = 'Location B' which filters out all your data.

 

At the moment you cannot use single select slicers with URL filters.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors