Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BenjaminFernet
Regular Visitor

Exact match text filter

Hello!

 

I have a Power BI report that contains 2 tables. The first, Customers, is a list of customer numbers (unique) and their account number. The second, Accounts, is a list of account numbers (unique) and the price of their subscription. I have a SELECTEDVALUE measure on Accounts[Price] that I use in card. The idea is that the user filters the Customers table using the customer number, which then returns a single row in Accounts (because of the 2-way relation on the account number) and the card shows the price.

 

The issue I have is that I need the user to enter the customer number in a textbox style filter. The ones I have found work as a contains filter, meaning that if they search for customer 12, then customers 123 and 124 are not filtered out. I've been trying to solve this in many ways in vein. Is there a way to filter on the exact value only? I've been toying with the idea of only keeping the minimum customer number when more than 1 are returned but could not make it work.

 

Thanks in advance!


BenjaminFernet_0-1718110581812.png

 

2 ACCEPTED SOLUTIONS
BenjaminFernet
Regular Visitor

What I ended up doing is change the source code of the Text Filter made by Microsoft. Somewhere in there, you can change the operator from "Contains" to "Is" and recompile the visual.

View solution in original post

Sure!

 

First I downloaded the widget's source code from their repo here.

 

Then I installed pbiviz by following this tutorial.

 

Finally, I modified the source code. Here is a summary of the changes I made :

 

  • in src/visuals.ts I changed the performSearch function to use the operator "Is" instead of "Contains"
  • in pbiviz.json, I changed the name, display name and version

I then recompiled it using the pbiviz doc. It's been working quite well.

View solution in original post

4 REPLIES 4
BenjaminFernet
Regular Visitor

What I ended up doing is change the source code of the Text Filter made by Microsoft. Somewhere in there, you can change the operator from "Contains" to "Is" and recompile the visual.

could you please explain in details how to do this? I need the same Is.

Thank you!

Sure!

 

First I downloaded the widget's source code from their repo here.

 

Then I installed pbiviz by following this tutorial.

 

Finally, I modified the source code. Here is a summary of the changes I made :

 

  • in src/visuals.ts I changed the performSearch function to use the operator "Is" instead of "Contains"
  • in pbiviz.json, I changed the name, display name and version

I then recompiled it using the pbiviz doc. It's been working quite well.

amitchandak
Super User
Super User

@BenjaminFernet , Based on what I got. The search option on the Normal slicer can work with a Text field. Yes, it do work only if select an exact value.

 

For search, you can use

Text Filter Slicer and how to search on Multiple columns: https://youtu.be/RbeZRJ3uAZE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors