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