Forum Discussion

hamzaou's avatar
hamzaou
New Member
1 year ago

slicer for filtering out values

I need to filter out values based on the slicer. So the slicer has country names. What I want is that when I click on Belgium and on Netherlands it should filter out all the Belgium and Netherlands data, but keep the rest of the countries.

How do I go about this? I tried using a measure and then filtering on it, but it did not work.

3 Replies

  • hamzaou , You can try below steps

     

    First, create a calculated column that flags the countries you want to exclude based on the slicer selection.

    ExcludeCountry =
    IF(
    'Table'[Country] IN {"Belgium", "Netherlands"},
    1,
    0
    )

     

    Alternatively, you can create a measure if you prefer to use it in your visualizations.
    ExcludeCountryMeasure =
    IF(
    SELECTEDVALUE('Table'[Country]) IN {"Belgium", "Netherlands"},
    1,
    0
    )

     


    Apply the Filter: Use the calculated column or measure to filter your data in the visualizations. For example, you can add a visual-level filter to exclude the flagged countries.

    If you used a calculated column, you can add a filter to your visualizations where ExcludeCountry is 0.
    If you used a measure, you can add a filter to your visualizations where ExcludeCountryMeasure is 0.
    Adjust the Slicer: Ensure that your slicer is set up to allow multiple selections and that it is not affecting the calculated column or measure directly.

    By following these steps, you should be able to filter out the data for Belgium and Netherlands while keeping the rest of the countries in your Power BI report.

  • Hi hamzaou 

     

    Bu using select all you can achieve it.

     

    Step-1

    Turn on 'Select All' option

    Stpe-2

    In slier check "select All" then uncheck Belgium and Netherlands.

     

    Hope this will help you