Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
1 | Bob | 77002 | Running |
2 | Sally | 77375 | Sewing |
3 | Meredith | 77492 | Cooking |
4 | Sean | 77581 | Gardening |
Event ID | Event Name | Event Date | Event Zip Code | Event Focus |
1 | Quilting Club Meeting | 9/1/2025 | 77028 | Crafting |
2 | Intro to Parkour | 8/1/2025 | 77009 | Advanced Sports |
3 | Fun Run with Friends | 10/1/2025 | 77026 | Sports |
Example Desired Output:
Any ideas appreciated. Thank you!
Solved! Go to Solution.
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,
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:
Map with Member filter applied:
Map with Event and Member filters applied:
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:
Again, thank you so much!
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,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |