Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create a dynamic filter based on another one

Greeting lovely members .    im trying to create a dynamic filter based on another filter .  an Exemple :    so let's say i have a filter called Years and another filter called Zone  .    what...
  • v-alq-msft's avatar
    6 years ago

    Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end,

    Table:

     

    Zones:

     

    You may create a measure as below.

    Visual Control = 
    IF(
        HASONEVALUE(Zones[Zone]),
        SWITCH(
            SELECTEDVALUE(Zones[Zone]),
            "Zone 1",
            IF(
                SELECTEDVALUE('Table'[Year]) in {1990,1995,2002,2003,2004},
                1,0
            ),
            "Zone 2",
            IF(
                SELECTEDVALUE('Table'[Year]) in {2005,2006,2009},
                1,0
            ),0
        ),0
    )

     

    Finally you need to put the measure in the visual level filter to get the result.

     

    Best Regards

    Allan

     

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