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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MD101
Regular Visitor

Add multiple filterable data layers to Azure Map Visual

 

Below is a mock scenario/data I have created to illustrate a real scenario I am trying to solve.

 

Background:

I work for an organization that has a geographically dispersed membership and holds geographically dispersed events.

I have a published Power BI report that includes an Azure Maps visual. This map shows the locations of all members by zip code and can be filtered by relevant member attributes (member interest, eligibility, etc.). Event planners can use the selection tool in Azure Maps to, for example, select potential locations for future events based on the number of members that could reach the event within an hour drive.

 

Goal:

Add additional data entities to the same Azure Map visual in such a way that each entity can be filtered without affecting the others.

For example, add Event Locations to the map that can be filtered by Event Type, Past vs Future Event, etc. - while also being able to independently filter Members by their own relevant attributes.

 

Current partial solution:

I have tried appending both Members and Events into one table. This allows me to plot both on the same map, but not to filter (e.g.) by Event Type without also filtering out all Members.

 

Question:

Is there a way, through data modeling or modifying the Azure Maps visual, I could achieve this goal? I would prefer to continue using the Azure Maps visual if possible rather than purchasing a seperate mapping tool.

 

Example datasets:

 

 

Member ID  Member Name  Member Zip Code  Member Interest  
1Bob77002Running
2Sally77375Sewing
3Meredith77492Cooking
4Sean77581Gardening

 

 

 

Event ID  Event Name  Event Date  Event Zip Code  Event Focus  
1Quilting Club Meeting9/1/202577028Crafting
2Intro to Parkour8/1/202577009Advanced Sports
3Fun Run with Friends10/1/202577026Sports

 

 

 

Example Desired Output:

 

 

MD101_2-1752673845383.png

 

 

Any ideas appreciated. Thank you!

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @MD101 ,

 

Yes, you can absolutely achieve this. The solution involves combining your data tables and then using a special DAX measure to control how the slicers filter the map visual, ensuring each slicer only affects its intended data type.

 

First, you'll need to go into the Power Query Editor to combine your Members and Events tables. Before you combine them, you should add a Custom Column to each table called EntityType. In the Members table, the value for this column will be "Member", and in the Events table, it will be "Event". Also, standardize the column names, for instance, renaming Member Zip Code and Event Zip Code to just Zip Code, and Member Interest and Event Focus to Attribute. Then, append these two tables into a new single table called MapData.

 

Next, you need to create two separate, disconnected tables that will be used for your slicers. These tables must not have any relationships to other tables in your model. You can create them using DAX on the Modeling tab by selecting New Table.

 

For the event slicer, use this formula:

Event Slicers = DISTINCT(Events[Event Focus])

For the member slicer, use this formula:

Member Slicers = DISTINCT(Members[Member Interest])

Now, you'll create the DAX measure that does the heavy lifting. This measure will check the selections in your new slicer tables and tell the map which points to show. It works by checking the EntityType of each point and then seeing if its Attribute matches the selection in the corresponding slicer. The measure returns a 1 if the point should be shown and a 0 if it should be hidden.

 

Create a new measure in your MapData table with the following code:

Show Location = 
VAR SelectedEntityType = SELECTEDVALUE(MapData[EntityType])
VAR SelectedAttribute = SELECTEDVALUE(MapData[Attribute])

VAR IsEventSelectionMade = ISFILTERED('Event Slicers'[Event Focus])
VAR IsMemberSelectionMade = ISFILTERED('Member Slicers'[Member Interest])

VAR IsEventVisible = 
    IF(
        NOT(IsEventSelectionMade), 
        TRUE(), -- If no event type is selected, show all events
        SelectedAttribute IN VALUES('Event Slicers'[Event Focus])
    )

VAR IsMemberVisible = 
    IF(
        NOT(IsMemberSelectionMade),
        TRUE(), -- If no member interest is selected, show all members
        SelectedAttribute IN VALUES('Member Slicers'[Member Interest])
    )

RETURN
    IF(
        (SelectedEntityType = "Event" && IsEventVisible) || 
        (SelectedEntityType = "Member" && IsMemberVisible),
        1, 
        0
    )

Finally, set up your report page. Add two slicers, one using the Event Slicers[Event Focus] column and the other using Member Slicers[Member Interest]. Add your Azure Maps visual and configure it using your combined MapData table: drag Zip Code to Location and EntityType to Legend. The last step is to select the map visual, drag your [Show Location] measure to the Filters on this visual pane, set the condition to "is 1", and click "Apply filter." This will make the slicers work independently, just as you wanted.

 

Best regards,

View solution in original post

2 REPLIES 2
MD101
Regular Visitor

Wow DataNinja777 - thank you so much!

 

I really appreciate you taking the time to write out this elegant solution so clearly.

 

I have successfully recreated your recommendation using my example data.

 

Base Map:

MD101_0-1752679099755.png

 

 

Map with Member filter applied:

MD101_1-1752679168289.png

 

Map with Event and Member filters applied:

MD101_2-1752679243529.png

 

In my real life scenario both my Members and Events data sets have many attributes that will all need to be filterable. I believe I have worked out a way to extend this model with additional attributes - here is my code which includes additions for an Event Date filter that appears to work as required. 

 

 
Show Location = 
VAR SelectedEntityType = SELECTEDVALUE(MapData[EntityType])
VAR SelectedAttribute = SELECTEDVALUE(MapData[Attribute])
VAR SelectedEventDate = SELECTEDVALUE(MapData[Date])

VAR IsEventSelectionMade = ISFILTERED('Event Focus Slicer'[Attribute])
VAR IsMemberSelectionMade = ISFILTERED('Member Interest Slicer'[Attribute])
VAR ISEventDateSelectionMade = ISFILTERED('Event Date Slicer'[Date])

VAR IsEventVisible = 
    IF(
        AND(NOT(ISEventSelectionMade), NOT(ISEventDateSelectionMade)),
        TRUE(),
        AND(SelectedAttribute IN VALUES('Event Focus Slicer'[Attribute]), SelectedEventDate IN VALUES('Event Date Slicer'[Date]))
    )

VAR IsMemberVisible = 
    IF(
        NOT(IsMemberSelectionMade),
        TRUE(),
        SelectedAttribute IN VALUES('Member Interest Slicer'[Attribute])
    )

RETURN
    IF(
        (SelectedEntityType = "Event" && IsEventVisible) ||
        (SelectedEntityType = "MEmber" && IsMemberVisible),
        1,
        0
    )

 

Output:

 

MD101_3-1752680175785.png

 

Again, thank you so much!

 

 

DataNinja777
Super User
Super User

Hi @MD101 ,

 

Yes, you can absolutely achieve this. The solution involves combining your data tables and then using a special DAX measure to control how the slicers filter the map visual, ensuring each slicer only affects its intended data type.

 

First, you'll need to go into the Power Query Editor to combine your Members and Events tables. Before you combine them, you should add a Custom Column to each table called EntityType. In the Members table, the value for this column will be "Member", and in the Events table, it will be "Event". Also, standardize the column names, for instance, renaming Member Zip Code and Event Zip Code to just Zip Code, and Member Interest and Event Focus to Attribute. Then, append these two tables into a new single table called MapData.

 

Next, you need to create two separate, disconnected tables that will be used for your slicers. These tables must not have any relationships to other tables in your model. You can create them using DAX on the Modeling tab by selecting New Table.

 

For the event slicer, use this formula:

Event Slicers = DISTINCT(Events[Event Focus])

For the member slicer, use this formula:

Member Slicers = DISTINCT(Members[Member Interest])

Now, you'll create the DAX measure that does the heavy lifting. This measure will check the selections in your new slicer tables and tell the map which points to show. It works by checking the EntityType of each point and then seeing if its Attribute matches the selection in the corresponding slicer. The measure returns a 1 if the point should be shown and a 0 if it should be hidden.

 

Create a new measure in your MapData table with the following code:

Show Location = 
VAR SelectedEntityType = SELECTEDVALUE(MapData[EntityType])
VAR SelectedAttribute = SELECTEDVALUE(MapData[Attribute])

VAR IsEventSelectionMade = ISFILTERED('Event Slicers'[Event Focus])
VAR IsMemberSelectionMade = ISFILTERED('Member Slicers'[Member Interest])

VAR IsEventVisible = 
    IF(
        NOT(IsEventSelectionMade), 
        TRUE(), -- If no event type is selected, show all events
        SelectedAttribute IN VALUES('Event Slicers'[Event Focus])
    )

VAR IsMemberVisible = 
    IF(
        NOT(IsMemberSelectionMade),
        TRUE(), -- If no member interest is selected, show all members
        SelectedAttribute IN VALUES('Member Slicers'[Member Interest])
    )

RETURN
    IF(
        (SelectedEntityType = "Event" && IsEventVisible) || 
        (SelectedEntityType = "Member" && IsMemberVisible),
        1, 
        0
    )

Finally, set up your report page. Add two slicers, one using the Event Slicers[Event Focus] column and the other using Member Slicers[Member Interest]. Add your Azure Maps visual and configure it using your combined MapData table: drag Zip Code to Location and EntityType to Legend. The last step is to select the map visual, drag your [Show Location] measure to the Filters on this visual pane, set the condition to "is 1", and click "Apply filter." This will make the slicers work independently, just as you wanted.

 

Best regards,

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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