Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
taylorpeter55
Frequent Visitor

URL Filter - Seeking help on IN filter

Hi all, 

Apologies for yet another post regarding URL filtering - I've trawled through the forum and watched every YouTube video I can find.

 

Eventually, i've managed to get the following URL filter to work: 

 

https://app.powerbi.com/groups/XXX67XXXX/reports/XXX67XXXX-XXX67XXXX/ReportSection?filter=AutomationLibrary%2FTechnology%20eq%20%27KNIME%27

 

However, when I update the above URL to try and filter on the column Project Type for value 'Other' it now doesn't work (despite adding correct syntax between the words Project and Type. 

 

**I've removed the initial URL path to make it easier to read :-)**

ReportSection?&filter=AutomationLibrary%2FProject%20Type%20eq%20%27Other%27

 

Can anyone advise why this second URL filter may not work? 

 

However, the above was to try and understand relevant syntax etc.

 

Now to my main intention.  I actually need to filter the Table AutomationLibrary on column Project Type for values 'All Project Types' and 'Corporate Restructure'. 

 

I've compiled my URL filter using the in syntax and it just won't work: 

 

/ReportSection?&filter=AutomationLibrary%2FProject%20Type%20in%20(%27All%20Project%20Types%27,%27Corporate%20Restructure%27)

 

Please can anyone advise where my issue lies and why the URL filters above are not working? 

 

Thanks in advance.

Pete

 

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

Hi @taylorpeter55

This page covers all of the URL filter encoding rules:

https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

 

Particular rules that are relevant for your situation:

  1. Spaces in table or column names must be encoded as _x0020_
    This is why the Project Type filter wasn't working.
  2. Spaces and other special characters in values must be encoded generally using %-code, e.g. space is %20.
    (already appears correct in your example).

For your particular filter, this should be the correct filter portion of the URL:

filter=AutomationLibrary/Project_x0020_Type%20in%20(%27All%20Project%20Types%27,%27Corporate%20Restructure%27)

 I tested this with a dummy report myself and it worked as intended.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

OwenAuger
Super User
Super User

Hi @taylorpeter55, no worries, good to hear from you!

 

I had a look through the URL filter documentation and there don't appear to be any substring-based filtering options. The 'in' filter just checks for an exact match with any of the items between the brackets.

 

While Power BI URL filters are based on OData filters, Power BI has a more limited set of options unfortunately.

 

I would instead recommend adjusting the semantic model so that you can use an 'in' filter on another specially constructed table. I have attached a PBIX as an example.

 

Here are the steps I would suggest:

 

1. Create a new table, which I called 'Project Type Concatenated'. This contains the distinct values from AutomationLibrary[Project Type] (each of which is a comma-delimited list):

OwenAuger_7-1724069042733.png

2. Create another new table, which I called 'Project Type Individual'. This contains all combinations of the original Project Type Concatenated values and the individual Project Type values. I created it using the Splitting function in Power Query:

OwenAuger_8-1724069063607.png

3. Create relationships as follows
(note the bidirectional relationship between 'Project Type Concatenated' and 'Project Type Individual') :

OwenAuger_3-1724068381694.png

4. Now, you can apply a filter on 'Project Type Individual'[Project Type], and this will have the effect of selecting any of the original Project Type column containing any of the selected individual Project Types:

OwenAuger_6-1724069017819.png

5. For the URL filter, apply the 'in' filter to 'Project Type Individual'[Project Type]:

 

 

filter=Project_x0020_Type_x0020_Individual/Project_x0020_Type%20in%20(%27All%20Project%20Types%27,%27Corporate%20Restructure%27)

 

 

 

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

4 REPLIES 4
OwenAuger
Super User
Super User

Hi @taylorpeter55, no worries, good to hear from you!

 

I had a look through the URL filter documentation and there don't appear to be any substring-based filtering options. The 'in' filter just checks for an exact match with any of the items between the brackets.

 

While Power BI URL filters are based on OData filters, Power BI has a more limited set of options unfortunately.

 

I would instead recommend adjusting the semantic model so that you can use an 'in' filter on another specially constructed table. I have attached a PBIX as an example.

 

Here are the steps I would suggest:

 

1. Create a new table, which I called 'Project Type Concatenated'. This contains the distinct values from AutomationLibrary[Project Type] (each of which is a comma-delimited list):

OwenAuger_7-1724069042733.png

2. Create another new table, which I called 'Project Type Individual'. This contains all combinations of the original Project Type Concatenated values and the individual Project Type values. I created it using the Splitting function in Power Query:

OwenAuger_8-1724069063607.png

3. Create relationships as follows
(note the bidirectional relationship between 'Project Type Concatenated' and 'Project Type Individual') :

OwenAuger_3-1724068381694.png

4. Now, you can apply a filter on 'Project Type Individual'[Project Type], and this will have the effect of selecting any of the original Project Type column containing any of the selected individual Project Types:

OwenAuger_6-1724069017819.png

5. For the URL filter, apply the 'in' filter to 'Project Type Individual'[Project Type]:

 

 

filter=Project_x0020_Type_x0020_Individual/Project_x0020_Type%20in%20(%27All%20Project%20Types%27,%27Corporate%20Restructure%27)

 

 

 

Does something like this work for you?

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

@OwenAuger Thank you so much! This solution is brilliant 🙂

 

I've replicated it in my full dashboard and the dashboard and URL filter are now working perfectly 🙂


I honestly can't thank you enough - I will certainly remember this solution and will definitely be reusing it in future.

 

Pete 

OwenAuger
Super User
Super User

Hi @taylorpeter55

This page covers all of the URL filter encoding rules:

https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

 

Particular rules that are relevant for your situation:

  1. Spaces in table or column names must be encoded as _x0020_
    This is why the Project Type filter wasn't working.
  2. Spaces and other special characters in values must be encoded generally using %-code, e.g. space is %20.
    (already appears correct in your example).

For your particular filter, this should be the correct filter portion of the URL:

filter=AutomationLibrary/Project_x0020_Type%20in%20(%27All%20Project%20Types%27,%27Corporate%20Restructure%27)

 I tested this with a dummy report myself and it worked as intended.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

@OwenAuger Apologies for the delay in replying, I have been out of the office with no access to my laptop. 

 

Thanks so much for your response, I really appreciate it. 

 

I've tried your URL filter for 'All Project Types' and 'Corporate Restructure' and it correctly filters on rows with these categories called out individually:

 

taylorpeter55_0-1724058723583.png

However, I was hoping (rightly or wrongly) that the IN function would also filter on rows that contain one of the above values in addition to other categories. 

Example:

taylorpeter55_1-1724058886725.png

Is the IN function capable of identifying these rows? Or is there a different function that I could  use to include these rows?

 

Ideally, I would want to see all 5 rows in the above 2 screenshots included by the same URL filter (i.e. include any rows that contain the category rather than an exact match). 

 

Thanks in advance for any further guidance you can provide. 


Pete

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors