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 ,
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,