Forum Discussion

omelei86's avatar
omelei86
Frequent Visitor
4 years ago
Solved

Filter in multiple columns

Hi    I am relatively new to PowerBI. Hope you can help.    Table Opportunities   Opportunity ID Sales Team (coming from Opp owner) Sales Team (coming from Revenue responsible) X...
  • tamerj1's avatar
    4 years ago

    Hi omelei86 
    Please refer to sample file with the solution https://www.dropbox.com/t/YXMM3TcOQdZ9yboj

    First create the filter table 

     

     

    Filter Table = 
    SELECTCOLUMNS ( 
        DISTINCT ( 
            UNION ( 
                VALUES ( Opportunities[Sales Team (Opp owner)] ), 
                VALUES ( Opportunities[Sales Team (Revenue responsible)] ) 
            )
        ),
        "Sales Team", [Sales Team (Opp owner)]
    )

     

     

    Then Create new measure

     

     

    Filter = 
    COUNTROWS ( 
        FILTER ( 
            Opportunities, 
            Opportunities[Sales Team (Opp owner)] IN ALLSELECTED ( 'Filter Table'[Sales Team] ) 
                || Opportunities[Sales Team (Revenue responsible)] IN ALLSELECTED  ( 'Filter Table'[Sales Team] ) 
        ) 
    )

     

     

    Place it in the filter pane of the table visual then select "Is not blank" and apply.