Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

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

vcgaomsft_0-1660022220410.png

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:

vcgaomsft_1-1660022346318.png

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

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Anonymous ,

 

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

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

vcgaomsft_0-1660022220410.png

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:

vcgaomsft_1-1660022346318.png

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

amitchandak
Super User
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]) )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.