Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to create chart based on column value related selected slicer value

Hi,

 

I am struggling with the following and would be grateful for any help/direction. 

 

I have a slicer for selecting  <Location> and I would like to create a chart showing all <Locations> within the <Area> of the selected location. 

For example, when "a" is selected on the slicer, a chart will show all locations and values within x, including "a". 

 

LocationAreaValue

a

x1
by2
cz3
dx4
ex5
fy6
gz7
hz8
ix9
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    1. Please first create a table and use it as a field for the slicer.

    Table 2 = DISTINCT('Table'[Location])

    2. Then create a new measure for the table visual filter and go ahead and set it up as in the picture.

    Filter = 
    VAR _slicer =
        SELECTEDVALUE ( 'Table 2'[Location] )
    VAR _area =
        CALCULATE (
            MAX ( 'Table'[Area] ),
            'Table'[Location] = _slicer 
        )
    VAR _filter =
        IF ( MAX ( 'Table'[Location] ) = _slicer || MAX ( 'Table'[Area] ) = _area, 1 )
    RETURN
        _filter

    3. Result:

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    1. Please first create a table and use it as a field for the slicer.

    Table 2 = DISTINCT('Table'[Location])

    2. Then create a new measure for the table visual filter and go ahead and set it up as in the picture.

    Filter = 
    VAR _slicer =
        SELECTEDVALUE ( 'Table 2'[Location] )
    VAR _area =
        CALCULATE (
            MAX ( 'Table'[Area] ),
            'Table'[Location] = _slicer 
        )
    VAR _filter =
        IF ( MAX ( 'Table'[Location] ) = _slicer || MAX ( 'Table'[Area] ) = _area, 1 )
    RETURN
        _filter

    3. Result:

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

  • Anonymous , Create an independent Location table

    Location= Distinct(Table[Location])

     

     

    Then create a measuer like

    measure  =

    var _tab = Sumamrize(Filter(Table, Table[Location] in values(Location[Location])  ) , Table[Area] )

    return

    calculate(Sum(Table[Values]), filter(Table, Table[Area] in _tab) , Values(Table[Area]) )