Forum Discussion
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".
| Location | Area | Value |
a | x | 1 |
| b | y | 2 |
| c | z | 3 |
| d | x | 4 |
| e | x | 5 |
| f | y | 6 |
| g | z | 7 |
| h | z | 8 |
| i | x | 9 |
- Anonymous4 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 _filter3. Result:
Best Regards,
Gao
Community Support TeamIf 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
- AnonymousNot 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 _filter3. Result:
Best Regards,
Gao
Community Support TeamIf 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
- amitchandak
Super User
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]) )