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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
MTOnet
Helper III
Helper III

Filter Data Table Based on a Measure

I am having an issue finding a solution to a problem that i feel is doable.  What I am attempting to do is make a selection in one table and the have another table show only items that correspond to that selction.

I have two unreleated tables, Table1 and Table2.  

Table1
ID Issue Assigned Detected 1 Issue1 PersonA PersonB 2 Issue2 PersonA PersonC 3 Issue3 PersonD PersonE 4 Issue4 PersonB PersonB
5 Issue5 PersonB PersonA
Table2
Person  Status1 Status2 Status3
PersonA    1       2      1
PersonB    2       3      4
PersonE    4       5      6

(as far as this question in concerned, the status values (whcih are measures themselves) are irrelevent, but just to show how data is presented)

I would like to be able to select a row in Table 2 and then have table 1 filtered to display the selected person in Table 1 if they appear in the Assigned or Detected column.  So if I select PersonB in Table2, I should see ID's 1, 4 & 5 in Table1.

I have a measure that allows me to get the Person value from Table 2, but I can't figiure out how i can filter Table1 by it.  I tried with a calculated column,

Display = if(Table1[Deteted]=[Selected Person Table2] || Table1[Assigned]=[Selected Person Table2],1,0)

And then using a visual level filter to only show results where Display Is 1.

This didn't work like I was hoping.  In doing some more reading, it seems to be because the calculated column is only updated when the model is updated, not upon a selection.  I'm thinking this can be done through a measure, but I'm not sure how I can go through each table item to make this determination.

 

Any help or suggestions are greatly appreciated.

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @MTOnet ,

 

Your idea is right. You can create a measure:

Measure =
IF (
    SELECTEDVALUE ( Table1[Detected] ) = SELECTEDVALUE ( Table2[Person] )
        || SELECTEDVALUE ( Table1[Assigned] ) = SELECTEDVALUE ( Table2[Person] ),
    1,
    IF ( ISBLANK ( SELECTEDVALUE ( Table2[Person] ) ), 1, 0 )
)

Then put this measure in the filter of table 1.
1-1.PNG

Here is the result.
1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @MTOnet ,

 

Your idea is right. You can create a measure:

Measure =
IF (
    SELECTEDVALUE ( Table1[Detected] ) = SELECTEDVALUE ( Table2[Person] )
        || SELECTEDVALUE ( Table1[Assigned] ) = SELECTEDVALUE ( Table2[Person] ),
    1,
    IF ( ISBLANK ( SELECTEDVALUE ( Table2[Person] ) ), 1, 0 )
)

Then put this measure in the filter of table 1.
1-1.PNG

Here is the result.
1-2.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.