Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filters bases in another filter

Hello all,

 

I'm doing something a page on my dashboard where I want to filter the chart based on a previous selection, see the example below, I have selected a US State (New York) so the charts where says "Selected Geography" are filtering New York. What I want to do is that the charts on the right should be filtered by US for which I have a filter on the left of "New York". However I would be selecting US on the country filter, the charts on the right should be a world average.

 

Any idea / tip ?? Any help would be really appreciated.

Thanks

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    In order to achieve the goal of selecting states and then filtering out countries, you need to create a separate table about states, and then use DAX to map states to countries.

     

    Here is a simple example.

     

    Then just write a measure like this.

    FilteredValue =
    CALCULATE (
        SUM ( 'Main Table'[Value] ),
        FILTER (
            'Main Table',
            [Country]
                = CALCULATE (
                    VALUES ( 'Table'[Country] ),
                    FILTER ( 'Main Table', [State] IN ALLSELECTED ( 'Table'[State] ) )
                )
        )
    )
    

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Hi,

     

    You can use Edit Interactions option to control the filtering of the visual

     

    You can click on the slicer. In the Format option, you will able to see 

     

    and then block the visuals using this small option

    This way your slicer will stop controlling that particular visual

     

    Regards,

    Sayali

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

    • Anonymous's avatar
      Anonymous
      Not applicable

      I've that applied already, what I am looking for is different, if you select any state, the other filter should be having the country where that selected state is located

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    In order to achieve the goal of selecting states and then filtering out countries, you need to create a separate table about states, and then use DAX to map states to countries.

     

    Here is a simple example.

     

    Then just write a measure like this.

    FilteredValue =
    CALCULATE (
        SUM ( 'Main Table'[Value] ),
        FILTER (
            'Main Table',
            [Country]
                = CALCULATE (
                    VALUES ( 'Table'[Country] ),
                    FILTER ( 'Main Table', [State] IN ALLSELECTED ( 'Table'[State] ) )
                )
        )
    )
    

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.