The Filter mode in Smart Filter Pro allows advanced data queries by defining conditions using wildcards, comparison, and logical operators. The filter conditions – one or more – are written with a simple syntax giving instant results. One can search for specific date intervals, for numbers smaller or greater than others, for strings within a piece of text, and so on.
By allowing advanced search conditions for filtering, the Filter mode helps refine your search and eliminate any restrictions on which elements in a column to filter. For instance, the filter semantic that can be applied to the dates allows the user to specify complex rules in filtering dates that are not possible to define using the default slicers.
The Filter mode is very useful when you are dealing with huge datasets, and loading all data in memory can be very expensive. The other modes (except Search mode, which is similar to Filter mode) loads all the data in memory, so it can be slow in certain conditions. On the other hand, this mode uses a different approach that helps boost performance and load large datasets faster than ever.
How to Search
Unlike the Dropdown mode, which only allows simple queries, Filter mode supports advanced and powerful queries that you can you use to slice your data uniquely.
The syntax available differs depending on the type of the field to the visual, so here are the options for each type. Multiple conditions are combined using a logical operator specific for each field.
The syntax here is also supported by the Search mode. Learn more about the differences between Filter and Search modes.
The syntax for querying text fields includes rules for the most common uses:
You can perform a search that returns values containing your keyword without using any special characters if the Default Condition for Text is set to Contains, otherwise you can use the wildcard characters * and ? to define the part of the string you don’t know along with your keyword.
The character * is used to define an unknown string of any length.
The character ? defines a single unknown character.
You can use as many wildcards as you like and in any position with one exception: you can’t put a wildcard at the beginning of a string if there isn’t the same character at the end as well - in other words, the Ends with search is not supported.
audioreturns all values containing audio if the default condition for text is Contains, otherwise returns all values equal to audio (see Exact Match).
*audio*returns all values containing audio.
aud*returns all values starting with aud.
*udiois not supported and won’t return any results.
a??ioreturns values starting with a, followed by two characters and ending with io.
You can perform an exact match search without using any special characters if the Default Condition for Text is set to Equal to, otherwise you need to enclose your keyword in double quotes.
audioreturns all values equal to audio if the default condition for text is Equal to, otherwise returns all values containing audio (see Containing Text).
"audio"returns all values equal to audio.
Not Containing/Match Text
You can exclude a particular value from the results by prefixing the character ! to your keyword.
You can combine this with the other rules to create an advanced query.
!audioreturns all values except those that include audio if the Default Condition for Text option is Contains, otherwise returns all values except those equal to audio.
!*audio*returns all values except those that include audio.
!aud*returns all values except those starting with aud.
The Not condition is quite limited - you cannot add more than 20 keywords with Not in the same query.
The Filter mode provides a simple syntax to perform advanced queries on date fields:
The recommended format for entering dates is ISO 8601, but you can use a slight variation that best suits you. For example:
20080115are all valid and represent Jan 15, 2008.
You can use the common comparison operators to search for dates:
2008-01-15(no operators) searches for an exact match.
>2008-01-15apply a greater than comparison.
>=2008-01-15apply a greater than or equal to comparison.
<2008-01-15apply a less than comparison.
<=2008-01-15apply less than or equal to comparison.
!2008-01-15searches for dates different from the one provided – max 20 of these comparisons are allowed.
Date comparisons are not limited to days, you can also enter years or months and the filter will transform them to the first day of the period, if the comparison uses >, and to the last day, if the operator is <.
!2008means that you are searching for a date range. See below for more details.
You can query date ranges by combining two different comparisons and using the AND operator, or you can just use one of these shorthand syntaxes:
You can query a single a year with a 4-digit number, instead of two conditions.
2008is equivalent to
!2008is equivalent to
You can query a range of years with two numbers connected by a dash _.
2008_2010is equivalent to
You can query a single month with an ISO 8601 number (or a variation of it).
2008-01is equivalent to
As for the years, you can create complex ranges by using a dash _ with months.
2008.1_2010.6is equivalent to
The dash _ is available also with days - use the ISO 8601 format as described above.
20080115_20100615is equivalent to
These shortened ranges are inclusive - the first and last dates of the range are always included.
The syntax available for date fields is also supported by number fields. You can enter a number to perform an exact match search, you can perform standard comparisons, you can use the Not ! operator, and define ranges with dash _:
100means an exact match.
>100means greater than comparison.
>=100means greater than or equal to comparison.
<100means less than comparison.
<=100means less than or equal to comparison.
!100means not comparison.
100_200searches for a range of values between 100 and 200.
Search in Filter mode is always case insensitive - you can write keywords in any case and the matching algorithm won’t rely on that.
air conditioners, and
Air Conditionersproduce the same results.
In Filter mode, you can choose the logical operator to combine different conditions for each field. This means that all conditions share the same operator, but you can have different operators in each field.
The available operators are:
- AND: Use it when you want all the specified conditions to be satisfied.
- OR: Use it when you want at least one of the specified conditions to be satisfied.
You can set the operator with a specific option: Keywords Operator.
One of the main advantages of the Filter mode is the performance boost it offers. The Dropdown, Observer, and Hierarchy modes load all the items in memory, regardless of the filters applied by the user. The Filter mode is faster as it doesn’t load the values at all, but only applies a filter to the report.
In Dropdown, Observer, and Hierarchy modes, data is loaded incrementally when the visual is rendered and whenever a filter is applied to the report from any other visual. This means that clicking on any chart to slice the data in the report reactivates the process and could take many seconds to complete, depending on the number of rows in the column.
The performance boost is evident when we use a high cardinality column – a column that displays multiple distinct values – for filtering data. For instance, let us say you use the Dropdown mode and select Order Number – a high cardinality column – from the Sales table.
When you start typing order numbers in the textbox, the order numbers do not appear as immediately as they would for a column which is not a high cardinality column – Product Category, for example. Thus, the result set loading time is longer in Dropdown mode.
Moreover, loading many items in the visual increases the memory consumed, potentially creating performance issues for other applications running on the same machine. While in Filter mode, the values are not loaded at all; a filter is applied to the report so that the data that does not fit the rules is not loaded at all. In these conditions, the user experience is better with the Filter mode as it uses less system memory.
No Data Limits
Another benefit of Filter mode is that there are no limits on the volume of the dataset it can filter. That’s because it doesn’t load data into memory and, therefore, the common limits set by Power BI don’t apply here. The other modes (except Search mode), on the other hand, cannot load more than 1,048,576 rows and cannot exceed more than 100 MB of memory.