Forum Discussion
RE: Power BI Basic Map - Visual - Map Settings - Style
- 1 year ago
In Power BI, there isn’t a built-in feature to dynamically change the map style via a slicer. However, you can implement a workaround by creating multiple map visuals, each with a different style, and then using a slicer to toggle visibility between them.
Here’s how to set it up:
- Create Duplicate Map Visuals:
- Copy and paste your map visual several times, each copy using a different style (Aerial, Dark, Light, Grayscale, Road).
- Position them all in the same place on your report canvas, so they look like a single visual when displayed.
- Create a Table for Style Selection:
- Go to the “Model” view in Power BI and create a new table with a single column listing the map style options (Aerial, Dark, Light, Grayscale, Road).
- For example, you can use the following DAX formula to create this table:
DAX
MapStyles = DATATABLE(
"Style", STRING,
{
{"Aerial"},
{"Dark"},
{"Light"},
{"Grayscale"},
{"Road"}
}
)
- Add a Slicer for Map Style:
- Add a slicer visual to your report using the new MapStyles table, allowing the user to select the desired style.
- Add a slicer visual to your report using the new MapStyles table, allowing the user to select the desired style.
- Set Up Visual-Level Filters:
- For each map visual, go to the “Visualizations” pane and apply a filter on the MapStyles selection to display only the map that matches the slicer choice.
- For example, on the “Aerial” map visual, set a filter so it only shows when “Aerial” is selected in the slicer.
- Hide Unselected Maps:
- When setting up the filters, ensure that each map visual is only displayed based on the corresponding style selection in the slicer. This will effectively hide the other map visuals when a particular style is chosen.
- When setting up the filters, ensure that each map visual is only displayed based on the corresponding style selection in the slicer. This will effectively hide the other map visuals when a particular style is chosen.
By using this approach, your users can use the slicer to switch between different map styles without needing direct access to the map settings. This method requires more setup but provides the style flexibility you need.
If I have resolved your question, please consider marking my post as a solution🎉Thank you!. - Create Duplicate Map Visuals:
- Anonymous1 year ago
Hi Fidezuri1990 ,
As grazitti_sapna said, there is currently no way to switch map styles via the slicer. There is a workaround to create multiple maps stacked on top of each other and toggle their visibility via bookmarks:
I have attached a pbix file for your reference. Unfortunately bookmarks don't inherit the zoom from the last map, so if you have any suggestions and ideas to help make PBI better, feel free to submit them below:
Fabric IdeasBest 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 in the Power BI Forum
awesome, thank you so much! Both solutions work for me.