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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
adawo_
New Member

Filter all rows related to same ID based on criteria

Hello!

 

Not sure if I am overthinking it, but I need to filter out all rows related to the same ID, based on a criteria from another column, using a slicer.

 

Example: 

IDTeam
1TeamA
1TeamB
1TeamC
2TeamB
2TeamC
3TeamA
3TeamC

 

Essentially with this example, I would want a slicer with all the Teams and when the user selects TeamA for instance, the only result would be ID 2 (with its other corresponding data).

 

I would be using this in a bar chart, that counts the ID per team.

 

Thank you! 

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

Hi @adawo_ ,

According to your description "when the user selects TeamA for instance, the only result would be ID 2", here's my solution.

1.Create a new table with all teams, don't make relationship with the two tables.

Team = VALUES('Table'[Team])

vyanjiangmsft_0-1688623612270.png

2.Create a measure.

Measure =
IF (
    COUNTROWS (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Team] = SELECTEDVALUE ( Team[Team] )
                && 'Table'[ID] = MAX ( 'Table'[ID] )
        )
    ) > 0,
    1,
    0
)

Put the new created Team table in slicer and columns from fact table in visual, then put the measure in visual filter, select show items when the value is 0.

vyanjiangmsft_1-1688623887644.png

 

After apply filters, get the correct result:

vyanjiangmsft_2-1688624004113.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

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

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @adawo_ ,

According to your description "when the user selects TeamA for instance, the only result would be ID 2", here's my solution.

1.Create a new table with all teams, don't make relationship with the two tables.

Team = VALUES('Table'[Team])

vyanjiangmsft_0-1688623612270.png

2.Create a measure.

Measure =
IF (
    COUNTROWS (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Team] = SELECTEDVALUE ( Team[Team] )
                && 'Table'[ID] = MAX ( 'Table'[ID] )
        )
    ) > 0,
    1,
    0
)

Put the new created Team table in slicer and columns from fact table in visual, then put the measure in visual filter, select show items when the value is 0.

vyanjiangmsft_1-1688623887644.png

 

After apply filters, get the correct result:

vyanjiangmsft_2-1688624004113.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

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

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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 Solution Authors