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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
PetyrBaelish
Resolver III
Resolver III

Filter rows because "additional column" contains value

With data that looks similar to this ...

 

Username --- Group

John Smith -- GroupA

John Smith -- GroupC

Jane Doe -- GroupB

Jane Doe -- GroupC

Mike Brown -- GroupC

Mike Brown -- GroupD

 

I'm trying to filter out all rows where the user is a member of GroupA or GroupB. So on the example above I would expect rows 1-4 - that is both entries for John Smith and Jane Doe to be filtered out (even the ones for "GroupC"). I would expect rows 5 & 6 to still appear on the report as 2 separate rows).

 

I've tried to get the right formula, but can't figure out how to filter out rows 2 and 4.

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @PetyrBaelish 

 

You could create a new calculated table:

 

NewTable =
FILTER (
    Table1;
    ISEMPTY (
        INTERSECT (
            CALCULATETABLE (
                DISTINCT ( Table1[Group] );
                Table1[Username] = EARLIER ( Table1[Username] );
                ALL ( Table1 )
            );
            { "GroupA"; "GroupB" }
        )
    )
)

Another option, depending on what you want,  is to use a table visual with Username and Group in values (with "Don't summarize") and then create a measure as indicated below. Then place the new measure in visual level filters of the table visual and select 'Show items when the value is' --> 1    

 

ShowMeasure =
IF (
    ISEMPTY (
        INTERSECT (
            CALCULATETABLE ( DISTINCT ( Table1[Group] ); ALL ( Table1[Group] ) );
            { "GroupA"; "GroupB" }
        )
    );
    1
)

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @PetyrBaelish 

 

You could create a new calculated table:

 

NewTable =
FILTER (
    Table1;
    ISEMPTY (
        INTERSECT (
            CALCULATETABLE (
                DISTINCT ( Table1[Group] );
                Table1[Username] = EARLIER ( Table1[Username] );
                ALL ( Table1 )
            );
            { "GroupA"; "GroupB" }
        )
    )
)

Another option, depending on what you want,  is to use a table visual with Username and Group in values (with "Don't summarize") and then create a measure as indicated below. Then place the new measure in visual level filters of the table visual and select 'Show items when the value is' --> 1    

 

ShowMeasure =
IF (
    ISEMPTY (
        INTERSECT (
            CALCULATETABLE ( DISTINCT ( Table1[Group] ); ALL ( Table1[Group] ) );
            { "GroupA"; "GroupB" }
        )
    );
    1
)

 

Thanks - I went with the measure, which works perfectly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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