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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BDolphin
Helper I
Helper I

Filtered table to filter another table

I am looking to filter a table based on the filtered results from a drill through. On the main page I have a table of names, I would like to drillthrough and go to their "Associates" on another page. On the Associates page i would have a list of the Occurrence numbers related to the person I drilled through on. I would like to use that list to filter a duplicate copy of the main table (so the drillthrough does not apply), and return all the names of people that are not the Name i used to drill through. 

Here a sample dataset

 
OccurrenceNoName
12345Jim Bob
12345Diane Richardson
12345Sally Ann
12345Joe Smith
12346Jim Bob
12346Joe Smith
12346Jack Howard
12346Diane Richardson
12346Thomas Taylor
12347Jim Bob
12347Michael Peterson
12348Jim Bob
12348Sally Ann
12349Jim Bob
12349Diane Richardson
12350Diane Richardson
12350Joe Smith

If I drill through on Jim Bob, these are his occurrences, I need to use to get the names of his associates

OccList.JPG

These are the results I want

 

results.JPG

Thanks

 

1 ACCEPTED SOLUTION

Hello, @BDolphin

You can modify the "Count" measure as follows.

Count = 
SUMX(
    'Name Table',
    CALCULATE(
        COUNTROWS(
            FILTER(
                ALL('Table'),
                'Table'[Name] = MAX('Name Table'[Names])
                &&  'Table'[OccurrenceNo] in DISTINCT('Table'[OccurrenceNo])
            )
        )
    )
)

result:

a1.png

Best regards

Allan

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

View solution in original post

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @BDolphin 

 

Based on your description, I created data to reproduce your scenario.

Table:

d1.png

Name Table:

d2.png

 

You may create two measures as follows.

Isdiplay = 
IF(
    SELECTEDVALUE('Table'[Name]) = MAX('Name Table'[Names]),
    1,0
)

Count = 
SUMX(
    'Name Table',
    CALCULATE(
        COUNTROWS(
            FILTER(
                ALL('Table'),
                'Table'[Name] = MAX('Name Table'[Names])
            )
        )
    )
)

 

Then you can put 'Isdisplay' to the visual level filter and set the field for drill through as 'Name'.

d3.png

 

Finally when you drill through from the Page1, you will get the expected result.

d4.png

d5.png

 

Best Regards

Allan

 

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

 

Thanks Allan, 

Its almost right, I only want the names of the people that share an occurrence with Jim Bob, for example, so the results should be 

results.JPG

On the last occurrence 12350 - Diane and Joe Smith are the only names listed so they should not be counted when drilling through on Jim Bob if that makes sense. 

 

Bre 

 

 

Hello, @BDolphin

You can modify the "Count" measure as follows.

Count = 
SUMX(
    'Name Table',
    CALCULATE(
        COUNTROWS(
            FILTER(
                ALL('Table'),
                'Table'[Name] = MAX('Name Table'[Names])
                &&  'Table'[OccurrenceNo] in DISTINCT('Table'[OccurrenceNo])
            )
        )
    )
)

result:

a1.png

Best regards

Allan

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

@v-alq-msft 

 

I have one more request, I am trying to put a card that would show the Count of the Names, so based on the example it would show the number 6.  

 

Thanks,  

Thank  you so much, that worked perfectly

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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