Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have an azure map with data plotted using lat/long. I have a table on the same page that has additional attributes/fields for the plotted data. As users move and zoom the map, I'd the table to only show the locations that are visible on the map. Is there way to set the interaction to visible points only or get the lat/long ranges of the visible area in the map to create a dynamic measure?
Solved! Go to Solution.
Hi @zamursaz , Thank you for reaching out to the Microsoft Community Forum.
Power BI’s Azure Maps visual currently doesn’t support dynamic filtering based on the visible map area (like map.getCamera().bounds in JavaScript). That means you can’t automatically filter a table based on what’s shown on the map when a user pans or zooms. However, a reliable workaround is to let users manually define the visible area using slicers for latitude and longitude ranges.
First, make sure your data has Latitude and Longitude columns and that they’re correctly categorized in Power BI under Modeling -> Data Category. Then, create two simple tables using DAX to provide range values for the slicers.
Example:
LatitudeRange = GENERATESERIES(-90, 90, 0.1)
LongitudeRange = GENERATESERIES(-180, 180, 0.1)
Next, add two slicers to your report: one using LatitudeRange[Value] and one using LongitudeRange[Value]. Set them to Between mode so users can select a range. Clearly label them as "Latitude Range" and "Longitude Range". Now, create a DAX measure that flags whether a data point is within the selected range.
Example:
IsVisible =
VAR MinLat = MIN(LatitudeRange[Value])
VAR MaxLat = MAX(LatitudeRange[Value])
VAR MinLon = MIN(LongitudeRange[Value])
VAR MaxLon = MAX(LongitudeRange[Value])
VAR Lat = SELECTEDVALUE(YourTable[Latitude])
VAR Lon = SELECTEDVALUE(YourTable[Longitude])
RETURN
IF(
Lat >= MinLat && Lat <= MaxLat &&
Lon >= MinLon && Lon <= MaxLon,
1,
0
)
After moving the map, use the Latitude and Longitude Range sliders to filter the data table to match the visible area. Consider turning off Auto Zoom (Format > Map Settings > View) and using Bookmarks to save common map views with pre-set ranges.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @zamursaz , Just checking in—were you able to resolve the issue?
If one of the replies helped, please consider marking it as "Accept as Solution" and giving a 'Kudos'. Doing so can assist other community members in finding answers more quickly.
Thank you!
Hi @zamursaz , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Hi @zamursaz , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Hi @zamursaz , Thank you for reaching out to the Microsoft Community Forum.
Azure Maps itself does not offer a built-in visible points only interaction for linked tables but you can easily implement this programmatically by using the map’s visible bounds. To achieve this, you should listen for the moveend event on the map, which triggers whenever the user pans or zooms. When this event fires, use map.getCamera().bounds to retrieve the current visible region. This will return two points, the southwest corner [west, south] and the northeast corner [east, north] of the map view. You can then filter your dataset by checking which points fall within these latitude and longitude boundaries.
If you are using a front-end framework like React or Angular, you would typically update the component’s state with the visibleData to automatically refresh the table display. For example, in React you would use setState or a state management hook like useState to re-render the table based on the filtered results.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
V-hashadapu,
Thank you for the reply. I'm using the Azure map visualization within PowerBI. The map.getCamera().bounds isn't recognized as a function in DAX. So i'm not able to use that.
Hi @zamursaz , Thank you for reaching out to the Microsoft Community Forum.
Power BI’s Azure Maps visual currently doesn’t support dynamic filtering based on the visible map area (like map.getCamera().bounds in JavaScript). That means you can’t automatically filter a table based on what’s shown on the map when a user pans or zooms. However, a reliable workaround is to let users manually define the visible area using slicers for latitude and longitude ranges.
First, make sure your data has Latitude and Longitude columns and that they’re correctly categorized in Power BI under Modeling -> Data Category. Then, create two simple tables using DAX to provide range values for the slicers.
Example:
LatitudeRange = GENERATESERIES(-90, 90, 0.1)
LongitudeRange = GENERATESERIES(-180, 180, 0.1)
Next, add two slicers to your report: one using LatitudeRange[Value] and one using LongitudeRange[Value]. Set them to Between mode so users can select a range. Clearly label them as "Latitude Range" and "Longitude Range". Now, create a DAX measure that flags whether a data point is within the selected range.
Example:
IsVisible =
VAR MinLat = MIN(LatitudeRange[Value])
VAR MaxLat = MAX(LatitudeRange[Value])
VAR MinLon = MIN(LongitudeRange[Value])
VAR MaxLon = MAX(LongitudeRange[Value])
VAR Lat = SELECTEDVALUE(YourTable[Latitude])
VAR Lon = SELECTEDVALUE(YourTable[Longitude])
RETURN
IF(
Lat >= MinLat && Lat <= MaxLat &&
Lon >= MinLon && Lon <= MaxLon,
1,
0
)
After moving the map, use the Latitude and Longitude Range sliders to filter the data table to match the visible area. Consider turning off Auto Zoom (Format > Map Settings > View) and using Bookmarks to save common map views with pre-set ranges.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
@zamursaz No.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |