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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Select Table rows based on another Table

Hi All,

 

I have the below requirement. Please check and help

 

I have 2 Tables ,Table 1 and Table 2 and i have requirment. when a row in Table 1 is selected, ONLY Matching values (Names)of Table 2 should be displayed. Ex: if i select any row which has Name=James in Table1, the Values which matches James in Table 2 should be selected and displayed,

Table 1:

NameAmountDateStatus
james20001/10/2000Approved
james10010/11/2000rejected
james12008/12/2000Approved
james500020/03/2021Approved
james150013/04/2021Approved
Ajay20001/10/2020Approved
Ajay210010/11/2000rejected
Ajay25008/12/2000Approved
Ajay1500020/03/2021Approved
Ajay250013/04/2021Approved
Ajay150015/04/2021rejected

 

Table 2:

NameYearApproved Amount
James20203200
James20216500
Ajay20204500
Ajay202117500
4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi Ajay,

 

There two ways to solve this question. Creating a relationship or using measure

 

A:creating a relationship

you can create a relationship between these tables and you can follow along with my steps.

1 after you create these tables you need, go to the model view

vchenwuzmsft_0-1629854390419.png

 

Under the home tab, select the Manage relationships

vchenwuzmsft_1-1629854390421.jpeg

 

2 Then it will show the manage relationship windows and click new icon.

3 In the Create relationship dialog box, in the first table drop-down list, select a table. Select the column you want to use in the relationship.

4 In the second table drop-down list, select the other table you want in the relationship. Select the other column you want to use, and then elect OK.

vchenwuzmsft_2-1629854390426.jpeg

 

5 then go to the report view, create two table visuals like these.

vchenwuzmsft_3-1629854390430.jpeg

 

Under such conditions, if you select any row which has Name=James in Table1, the Values which matches James in Table 2 should be selected and displayed.

 

If you would like to know more about how to create and manage relationships, please see the following articles.

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships

 

B:using a measure

Prerequisites: there no relationship between these tables.

1 After you create table, create a new measure

Measure 1 =

            Var _x=selectedvalues(table 1[Name])

            Return

            If( _x=max(table[Name]),1,0)

2 then put Measure 1 into table 2s Filters, setting the Measure 1 show items when the value is 1 as the following image show and apply filter.

vchenwuzmsft_4-1629854390431.png

 

3 Then you select any one of name in table 1, the table 2 will display matched name in table 2.

vchenwuzmsft_5-1629854390433.jpeg

 

 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I want to add this does not work for table visuals. The tables must be queries themselves and not a visual table for this to work. 

Mohammad_Refaei
Solution Specialist
Solution Specialist

You can create a many-to-many relationship between the name fields with bi-directional filtering thoug it is not the best approach.

It is better to create a name table and use it as attached

Greg_Deckler
Community Champion
Community Champion

@Anonymous Use a relationship between the two tables. If necessary, create a bridge table Table = DISTINCT('Table 1'[Name])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.