Forum Discussion

Anno2019's avatar
Anno2019
Icon for Helper IV rankHelper IV
3 years ago
Solved

Slicer to change column value selected

Hi Guru's

Need some Dax help.

I need to create a column that will change the values based on the value selected in the slicer.

Table'Region Name' is created to be used as the slicer.

based on the region, if user selects "East" as a region, then 'Data'[Region East] column data must display.

Appreciate the help.

 

  • Anno2019 

    We can write a measure to return the Region Owner like this.

     

     

    Region Owner = 
    VAR _Region = SELECTEDVALUE ( 'Region Name'[Regions] )
    RETURN
        SWITCH(
            _Region,
            "East", SELECTEDVALUE ( Data[Region East] ),
            "West", SELECTEDVALUE ( Data[Region West] ),
            "South", SELECTEDVALUE ( Data[Region South] ),
            "North", SELECTEDVALUE ( Data[Regioin North] )
        )

     

     

    Then set a filter on the visual to [Region Owner] is not empty.

     

    I have attached my sample file for you to look at.

     

2 Replies

  • Anno2019 

    We can write a measure to return the Region Owner like this.

     

     

    Region Owner = 
    VAR _Region = SELECTEDVALUE ( 'Region Name'[Regions] )
    RETURN
        SWITCH(
            _Region,
            "East", SELECTEDVALUE ( Data[Region East] ),
            "West", SELECTEDVALUE ( Data[Region West] ),
            "South", SELECTEDVALUE ( Data[Region South] ),
            "North", SELECTEDVALUE ( Data[Regioin North] )
        )

     

     

    Then set a filter on the visual to [Region Owner] is not empty.

     

    I have attached my sample file for you to look at.