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! Request now

Reply
adityakumar619
Helper II
Helper II

How to filter one table if clicks on any row of the another table

I have two tables one is "Sheet1" and other is "exp2".Suppose if i clicks on any row of table(i.e sheet1) it show the relavent data i.e filtered data coreesponding to that row.

 

Say if i click on below 2 row of table1 i.e "Sheet1",it should display rows correspondin to that in table2 i.e exp2.

And if i unselect that row,it should revert to my original data in table2i.e exp2

 

Note:here i don't want to use relationship within the datamodel by making connections i.e CPL of one table with CPL of other table.i.e many to many or one to many etc.

But needs to do via DAX using USERELATIONSHIP.Since i need to do this on the fly.

 

I have tried using below DAX but no luck.

Measure = IF(ISFILTERED('Sheet1'[CPL])=TRUE(),CALCULATETABLE(exp2,USERELATIONSHIP('exp2'[CPL],'Sheet1'[CPL])))

 

 

adityakumar619_0-1630918516464.png

 

 Desired o/p:

adityakumar619_1-1630919113306.png

if i unselects,it should revert to orignal data in exp2.

 

adityakumar619_2-1630919164347.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @adityakumar619 ,

 

Forget about the USERELATIONSHIP(). How about a single measure like below.

Measure = IF(SELECTEDVALUE(exp2[CPL]) in VALUES(sheet1[CPL]),1,0)

And you just need to add it to visual filter as below.

1.PNG

2.PNG

 

Best Regards,

Jay

View solution in original post

@Anonymous Checking on it

 

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @adityakumar619 ,

 

Forget about the USERELATIONSHIP(). How about a single measure like below.

Measure = IF(SELECTEDVALUE(exp2[CPL]) in VALUES(sheet1[CPL]),1,0)

And you just need to add it to visual filter as below.

1.PNG

2.PNG

 

Best Regards,

Jay

@Anonymous  how can i apply the  measure if the table2 column[cpl] has different values compared to table1[cpl].below measure is filtering only the common values in that column.

 

and it should filter the status table aswell.

 

Measure = IF(SELECTEDVALUE(exp2[CPL]) in VALUES(sheet1[CPL]),1,0)

adityakumar619_0-1631515156267.png

 

 

@Anonymous below is my expected output.if the common column contains different values.

 

adityakumar619_0-1631516690597.png

 

@Anonymous Checking on it

 

 

 

 

adityakumar619
Helper II
Helper II

Note:i need to do via on the fly click on any rows with out having relationship connections which i tried and succeed,but really i need to know via DAX simply by clicking and making the use of USERELATIONSHIP

Hi Team,Is anyone help on the above. As i need have relationship on the fly.so that it can filter the selected rows in the other table and if unselects i need to get my original data.

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 Kudoed Authors