Forum Discussion
Text slicer: pasting multiple values
- Anonymous1 year ago
Hi arawo ,
Thank you for the confirmation.
It's not currently possible to paste a comma separated list like blue, red, black directly into a native text slicer and have it filter by partial matches. However, this use case is well supported through other options.
The most effective approach is to use the free "Filter by List" custom visual from AppSource, which allows you to paste multiple values into a textbox and filters your data accordingly, even with partial matches in descriptions.
Alternatively, Power BI new list slicer( Preview features) supports pasting a list of exact values to filter, though it only works with full match.
While a DAX-based workaround using a disconnected input table can simulate this behavior, it is more complex and static. For ease of use and flexibility, the "Filter by List" custom visual is the recommended solution.
Hope this helps.If so,give us kudos and consider accepting it as solution.
Regards,
Pallavi G.
Hi arawo
Your Current Solution Isn't Working because the SELECTEDVALUE function only works with single selections - it won't handle multiple values in a text slicer, the substitution of semicolons to pipes isn't being applied to the actual search logic and the CONTAINSSTRING logic is reversed (you're checking if the article is in the search string, rather than if any search term is in the article)
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
)Thank you very much for explaining the problem with my formula. I wanted to use your formula, but PowerBi highlighted 3 errors in it: "Cannot find name 'PATHITEMALL', PATHITEMALL is not a function", in COUNTROWS TermsArray is not a parameter and also [VALUE] is marked as an error with the message "Cannot find name [VALUE]". Could I ask you to correct the errors? Or explain what is wrong? Unfortunately, I do not know PowerBI well enough to fix it myself. Thank you in advance for your help
- Elena_Kalina1 year agoSolution Sage
Hi arawo
Sorry for the slow reply!
Just enable Slicer Setting ->"Accept multiple values" in your text slicer settings. Then:
Type your first value and hit Enter,
Add the second value and press Enter again.
That’s it—you’re all set!
Here’s a quick video to show you how: https://www.youtube.com/watch?v=LbnY7uoU6bA.
- arawo1 year agoFrequent Visitor
I am aware of this solution, but as I mentioned in the first post, this solution takes a lot of time when I have to add many values, that's why I was looking for a solution using DAX.
- Anonymous1 year agoNot applicable
Hi arawo ,
Thank you for the confirmation.
It's not currently possible to paste a comma separated list like blue, red, black directly into a native text slicer and have it filter by partial matches. However, this use case is well supported through other options.
The most effective approach is to use the free "Filter by List" custom visual from AppSource, which allows you to paste multiple values into a textbox and filters your data accordingly, even with partial matches in descriptions.
Alternatively, Power BI new list slicer( Preview features) supports pasting a list of exact values to filter, though it only works with full match.
While a DAX-based workaround using a disconnected input table can simulate this behavior, it is more complex and static. For ease of use and flexibility, the "Filter by List" custom visual is the recommended solution.
Hope this helps.If so,give us kudos and consider accepting it as solution.
Regards,
Pallavi G.