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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sc27
Frequent Visitor

Search Box parameter for Paginated Report

Hello, I am trying to add a parameter to my report that will allow me to type in anything and then pass that value to a Path Contains filter condition to narrow down the results to only show values where what I typed is present. Is this possible? 

3 REPLIES 3
d_gosbell
Super User
Super User

Yes this is possible. If you make sure that your parameter is set as a text data type and that the Allow multiple values is set to false and the available values is set to None. Then the parameter box will just be a standard input box that the user can type any value they like into.

 

You possibly also need to check that the multi-value parameter option is off in the query to stop the query builder from injecting the RSCustomDaxFilter() function.

Where can I check for the multi-value parameter option? 

 

I was only able to get the text box to work by toggling "Allow blank values" to Yes and setting a default value to blank (I need this as an option as there will be instances where the user will not be inputting anything. Having as blank means "show all data for that field"). I am also having trouble passing the values of the text box into my dataset as a filter condition. 

 

Here is how i coded it -  FILTER( VALUES(Fact[Description]), ( PATHCONTAINS(@Description, Fact[Description] ) )),

 

Description is both the parameter name and the field name in this case


@sc27 wrote:

Where can I check for the multi-value parameter option? 


So that is really only a consideration if you are using the query builder to create your query and it sounds like you are hand editting your query. But it is a button in the query builder ribbon (see below)

 

d_gosbell_0-1628635108735.png


@sc27 wrote:

Where can I check for the multi-value parameter option? 

 

I was only able to get the text box to work by toggling "Allow blank values" to Yes and setting a default value to blank (I need this as an option as there will be instances where the user will not be inputting anything. 


So you are not required to set a default value if you don't want to, having a default will control whether your report waits for input and requires the user to click the button to run the report or whether it renders immediately. So if you want the report to show all data by default when the users first opens it, then they have an option to apply a more restrictive filter then setting the default to blank is fine.

 


@sc2 wrote:

Here is how i coded it -  FILTER( VALUES(Fact[Description]), ( PATHCONTAINS(@Description, Fact[Description] ) )),

 


That does not look correct, the PATHCONTAINS function searchs pipe delimited path strings. The way you have it your are searching the parameter using the field value which looks backwards to me.

 

But even then if you had an expression like PATHCONTAINS( "AB|CD|EF", "CD") it would return true because CD is a value between the | delimiters. However PATHCONTAINS( "AB|CD|EF", "C") would return false since C is not an exact match for any of AB or CD or EF

 

The way you have it coded it looks like you should be using a function like SEARCH or FIND to see if the parameter value exists somewhere in the Description column.

 

eg


FILTER( VALUES(Fact[Description]), SEARCH(@Description, Fact[Description]  ) >= 1 )

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors