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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
EVG-Questions
Frequent Visitor

How to filter all rows attached to an ID value

I'm trying to find all ID values containing a certain value. Example given here:

 

PowerBI Vraag 1.png

 In this example I need to find all ID values that contain a "D" and then assign a "1" to all rows with one of those ID values, including rows that don't actually contain "D".

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try this measure:

Countrows D =
VAR _D =
    CALCULATETABLE (
        VALUES ( 'FactTable'[Cat1] ),
        ALLEXCEPT ( FactTable, FactTable[ID] )
    )
RETURN
    IF ( "D" IN _D, 1, 0 )

result.png

 If you don't need the rows with 0, close the brackets after the 1 in the return IF expression





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

Try this measure:

Countrows D =
VAR _D =
    CALCULATETABLE (
        VALUES ( 'FactTable'[Cat1] ),
        ALLEXCEPT ( FactTable, FactTable[ID] )
    )
RETURN
    IF ( "D" IN _D, 1, 0 )

result.png

 If you don't need the rows with 0, close the brackets after the 1 in the return IF expression





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown
If it's not too much to ask, could you take a look at the question I posted here. I'm still having trouble with it. Thanks!

Thank you!

 

This does seem to work. I have some additional questions but I'll make a seperate message for those.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.