Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
In my current report I have a list of products that contains several thousand entries. There is also a column with the name of the articles next to the article number. Sometimes I need to search for specific articles by description. The text slicer allows me to enable the function of entering several values, but I have to do it on the principle "first value" -> add, "second value" -> add.
I would like to be able to paste a list in the text slicer in the form of e.g. blue, red, black, yellow and the text slicer would separate the values and search for all articles containing the entered phrase. So I created a text slicer and a list slicer and added a new measure:
ArtFiltr =
VAR EnterValue = SELECTEDVALUE(InputsValues[Search])
VAR TheList = SUBSTITUTE(EnterValue, ";", "|")
RETURN
IF (
CONTAINSSTRING( "|" & TheList & "|", "|" & SELECTEDVALUE(artlist[articledsc]) & "|" ),
1,
0
)
Then I added the articledsc to the lists slicer and the articledsc to text slicer and I also added my measure is 1 to the text slicer.
Unfortunately, my solution didn't work. So I would like to ask if it is possible to do such a search in text slicer?
Hi @arawo
ArtFilter = VAR SearchTerms = SELECTEDVALUE(InputsValues[Search], "") // Get the search text VAR TermsList = TRIM( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(SearchTerms, ",", "|"), ";", "|" ), " ", "|" ) ) // Replace common delimiters with pipes VAR TermsArray = IF( TermsList = "", {""}, PATHITEMALL(TermsList) ) // Split into array VAR CurrentArticle = SELECTEDVALUE(artlist[articledsc], "") RETURN IF( SearchTerms = "", // If no search term, include all 1, COUNTROWS( FILTER( TermsArray, CONTAINSSTRING(CurrentArticle, [Value]) ) ) > 0 // Return 1 if any search term is found in article )
Hi @arawo ,
While the standard Power BI text slicer doesn't natively allow you to filter by pasting a delimited list of values, you can achieve this powerful functionality through several effective methods. This overcomes the time-consuming process of adding filter values one by one, which is especially cumbersome for reports with thousands of entries. Solutions now exist, including a new preview feature, specialized custom visuals, and refined DAX measures, to enable filtering by a pasted list of article descriptions.
A recent Power BI update introduced a preview feature that directly supports pasting multiple values into slicers. To use this, you must first enable the "New list and button slicers" option in File > Options and settings > Options > Preview features. After restarting Power BI, you can copy a single column of values from your source (without a header) and paste it directly into the new list or button slicer, which will automatically filter the report based on your pasted list.
Another excellent approach is to use a custom visual from the AppSource marketplace called "Filter by List." After importing this visual into your report, you can add the data field you want to filter, such as artlist[articledsc], to its "Values" well. The visual will then display a text box where you can paste a list of values like "blue, red, black, yellow," and it will filter your report accordingly, providing a dedicated and user-friendly interface for this specific task.
For those who prefer a DAX-based solution, you can create a measure to handle the filtering logic. Your original DAX measure was a good attempt but contained a logical flaw in how it checked for the values. A more effective approach is to check if the concatenated list of search terms contains the current article description. Here is a refined DAX measure that correctly implements this logic:
ArtFiltr =
VAR EnteredValues = SELECTEDVALUE(InputsValues[Search])
VAR PreparedList = "|" & SUBSTITUTE(EnteredValues, ";", "|") & "|"
VAR CurrentArticle = "|" & SELECTEDVALUE(artlist[articledsc]) & "|"
RETURN
IF(
CONTAINSSTRING(PreparedList, CurrentArticle),
1,
0
)
This measure works by first taking the semi-colon delimited string from a separate input table. It then formats this string by enclosing it and replacing the delimiters with pipe symbols (|) to ensure exact word matches (e.g., "|blue|red|black|"). It similarly wraps the current article description from your list in pipe symbols. The CONTAINSSTRING function then correctly checks if the formatted list of desired articles contains the current article being evaluated. To implement this, you create a disconnected table for the text input, add the ArtFiltr measure, and then apply a filter to your visual where the measure's value is 1.
Best regards,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |