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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
martim0305
Frequent Visitor

Need Help with Searching for One Value and Filtering by Another in Power BI

Hey everyone,

I’m facing a challenge in Power BI and hoping someone can help me out. I have a dataset like this:

Student Class
John B
Mary B
Martin B
Louis A
Thomas A
Andrew A

My goal is to search for a specific student, for example, "John," and have Power BI automatically filter and display all students from the same class (in this case, all students from class B), instead of just showing data related to the selected student.

Is there a way to configure this in Power BI? Any tips or solutions would be much appreciated!

Thanks in advance!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@martim0305 

you need to duplicated the table. One is for filtering and the other is for displaying. 

then you create a measure

Measure =
VAR _class=max('Table'[Class])
return if (_class=max('Table 2'[Class]),1)
 
add this measure to visual filter and set to 1
 
11.PNG
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @martim0305 ,

Did the replies offered help you solve the problem, if it helps, you can consider to accept it as a solution so that more user can refer to, or if you have other problems, you can offer some information so that can provide more suggestion for you.

Best regards,

Lucy Chen

 

ryan_mayu
Super User
Super User

@martim0305 

you need to duplicated the table. One is for filtering and the other is for displaying. 

then you create a measure

Measure =
VAR _class=max('Table'[Class])
return if (_class=max('Table 2'[Class]),1)
 
add this measure to visual filter and set to 1
 
11.PNG
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It worked. Really thankful for your help!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




lbendlin
Super User
Super User

Use a disconnected reference table for your search and then use a measure as a visual filter for the actual data.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.