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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
khacwee
Frequent Visitor

How to get Document number that contains Item A, while keep other row info?

Hi all, I have Table A below:

 

Doc NumberItem
No.1A
No.1B
No.2A
No.3B
No.3C
No.4A
No.4C

I would like to get the Document number that contains item A,

but if i filter this table with ITEM = "ITEM A", the result will be:

 

Doc NumberItem
No.1A
No.2A
No.4A

 



However, My desired output is the table to filter Doc number that contains Item A, so the output will still display Doc No.1 with Item B.

 

Doc NumberItem
No.1A
No.1B
No.2A
No.4A
No.4C

 

I have tried with countrows filtering which does not work, any advice?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a measure like

Document is visible =
VAR CurrentDocument =
    SELECTEDVALUE ( 'Table A'[Document number] )
VAR DocsWithItemA =
    CALCULATETABLE (
        VALUES ( 'Table A'[Document number] ),
        REMOVEFILTERS (),
        'Table A'[Item] = "A"
    )
RETURN
    IF ( CurrentDocument IN DocsWithItemA, 1 )

and use that as a visual level filter on your table

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a measure like

Document is visible =
VAR CurrentDocument =
    SELECTEDVALUE ( 'Table A'[Document number] )
VAR DocsWithItemA =
    CALCULATETABLE (
        VALUES ( 'Table A'[Document number] ),
        REMOVEFILTERS (),
        'Table A'[Item] = "A"
    )
RETURN
    IF ( CurrentDocument IN DocsWithItemA, 1 )

and use that as a visual level filter on your table

Thanks ! work like charm!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors