Key Features:
- User-Friendly Interface: Enter terms, press return, and watch your report filter in real-time.
- Advanced Search Options: Perform phrase searches with quotes and toggle the Boolean operator to ‘OR’ for broader term matching.
- Localization: Defaults to the report theme’s colours and fonts, and the language settings of the user’s browser
- Customizable Design: Tailor the search box, placeholder text, and search button to fit your report’s style.
- Optimized Performance: Enjoy fast and efficient searches, even with large data sets.
Until today there were three visualizations with text searching capability – two are restricted to exact phrase matching, and the other offers far more than a basic search – and is priced accordingly.
The Search Box – A Custom Power BI Visual
Enter the Search Box – a simple visualization that works in a familiar way – people can enter any terms, press return, and the page will filter to items matching all of them; entering terms in quote marks will run a “phrase search”; and an optional AND/OR toggle allows users to change the behaviour to filter the page to any of the terms entered is also available:
A ‘clear terms’ icon appears as soon as any characters are entered into the search box; instructions appear on hover; and pressing enter performs the same action as pressing the ‘Search’ button which changes to a clock while the search is being performed. Here’s an example showing the search button with a red background, and searching for items which contain any of the entered terms:
Hovering over elements of the The Search Box generates context-sensitive help.
Formatting Options
Though the Search Box ought to default to the current theme’s colours and fonts, many options are available to edit the visual’s look and features:
- Input field settings
- Placeholder text
- The clear icon or text
- The placeholder text’s font family, colour, and size
- Padding
- Background colour
- Border colour and width
- Search button settings
- The search icon or text
- The icon or text’s font family, colour, and size
- Padding
- Background colour
- Border colour and width
- Boolean settings
- Enable the boolean AND/OR toggle
- Text font family and size
- Selected and unselected background colour
- Selected and unselected text colour
Optimizing the Search Index Column
The visualization is optimized for performance, taking the same time to load and run as the Microsoft Text Search visualization, all else being equal. Performance can be further improved, and this is especially recommended for large data sets, by optimizing the visual’s source column in Power Query following the steps below:
- Duplicate or reference the original query
- Remove columns other than the text and ID columns
- Clean the text column (Transform/Format/Clean)
- Lower-case the text column (Transform/Format/Lowercase)
- Swap out diacritics (á, é, and so on) for their ASCII equivalents (a, e) using
each Text.FromBinary(Text.ToBinary(_, 28597), TextEncoding.Ascii)})
- Keep words only using
each Text.Select(_, {"a".."z", " "})}
- Remove HTML using
each Html.Table(_, {{"TextIndex",":root"}})
- Remove stop words (a, and, also, and so on) by prefixing and suffixing the text column with ” “, using the function in replace several characters in a column in just one power query step, and a query based on one of these stop word lists prefixed and suffixed with ” “
- Trim the text column (Transform/Format/Trim)
- Filter out values with less than three characters from the text column by:
- Duplicating the text column
- Extract number of characters
- Filter to items greater than two
- Remove column
- Finally, remove duplicates
Save and close, then create a ‘both’ relationship between your new query and the original one on the ID column. This may impact phrase searching where stop words have been removed and a user searches for a phrase containing one.
3 replies on “Revolutionize Power BI with The Search Box Visual”
Hey, love “The Search Box”. Great tool for what I need. Question: Would it be possible to have a toggle for the “AND” and “OR” so that I could default it to “OR”? Let me know, thanks.
Hi Bryan, thank you for trying The Search Box out, and I’m delighted it’s meeting at least most of your needs. An earlier iteration had an option to change the default to ‘or’, though it was buggy and an edge case, so I took the easy option and removed it.
Could you possibly do a quick test? In edit mode, click on the ‘OR’, save the report, refresh, and see if it sticks as the default? If not, I’ll add the requirement to the backlog.
Please email [email protected] if you can think of any other even minor improvements, as releasing on the app store is a far bigger task than adding a feature.
Hi Adam. Yes, I tried that, but it unfortunately defaulted back to “AND”. It’s not a big deal; I was just seeing if it was a quick fix. Again, great tool, as I could not find another one like it. Keep up the great work! 🙂