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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
longlostlives
New Member

Filter Locations by Related Location

I have a table that stores locations that have been selected in a particular session. Here is some example data:

 

Session IDLocationLocation ID
1Washington1
1Dallas2
2Washington1
3Dallas2
3St. Paul3
3Boise4
4Boise4
4Seattle5

 

I want to display the list of locations in a slicer, and then based on the selected location, display all the other locations that have been chosen when that location was selected.

 

Examples:

 

If Washington is selected, then

 

Session IDLocationLocation ID
1Dallas2

 

If Dallas is selected then

 

Session IDLocationLocation ID
1Washington1
3St. Paul3
3Boise4

 

I will then display the locations on a map with the count of session ID used as the size indicator.

 

What's the best way to go about doing this? I have a related table for all Location and Location IDs, and could use that for the slicer although I would ideally just use the list of locations from the main table so only locations that have been selected appear in the slicer list.

 

Thanks in advance!

1 ACCEPTED SOLUTION
longlostlives
New Member

I ended up setting up a table in Power Query to contain all the required data instead of going the DAX route. It does the job and will monitor performance vs. trying again in DAX.

View solution in original post

3 REPLIES 3
longlostlives
New Member

I ended up setting up a table in Power Query to contain all the required data instead of going the DAX route. It does the job and will monitor performance vs. trying again in DAX.

longlostlives
New Member

@Greg_Deckler Thanks for the tip! I am able to get the selector working to display the results in a table, but I'm having trouble making it work when I try to count the Session ID for the map size parameter.

 

Here's what I have for the 'basic' selector:

Related Locations = 
VAR LocationID = MAX([LocationID])
VAR Location = MAX([Location])
VAR LocationSelected = VALUES(Locations[Location])
VAR TableSelected = SELECTCOLUMNS(FILTER(ALL(LocationCities), [Location] IN LocationSelected), "LocationID", [LocationID])
RETURN
IF (LocationID IN TableSelected && Location <> LocationSelected, 1, BLANK())

Any thoughts on how to modify this or set up another measure to use this to determine how many times each related location shows up?

Greg_Deckler
Community Champion
Community Champion

@longlostlives I think you will need a disconnected table for your slicer and then a Complex Selector for your table.

https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.