Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to apply a filter to multiple columns

I pretty new to Power BI and i have been trying to create a filter to show me which countries the names have been to but what happens is it only applies to the column "Country 1"   Name Country...
  • v-easonf-msft's avatar
    4 years ago

    Hi, Anonymous 

    You can create a new measure and apply it to visual filter pane:

    filter1 = 
    VAR a =
        IF (
            SELECTEDVALUE ( Table1[Country 1] )
                IN VALUES ( Country[Country Name] )
                    || SELECTEDVALUE ( Table1[Country 2] )
                        IN VALUES ( Country[Country Name] )
                            || SELECTEDVALUE ( Table1[Country 3] ) IN VALUES ( Country[Country Name] ),
            1,
            0
        )
    RETURN
        IF ( ISFILTERED ( Country[Country Name] ), a, 0 )

    Best Regards,
    Community Support Team _ Eason