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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
zamursaz
Frequent Visitor

Filter table to show only visible points on a azure map

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?

1 ACCEPTED 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.

View solution in original post

7 REPLIES 7
v-hashadapu
Community Support
Community Support

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!

v-hashadapu
Community Support
Community Support

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.

v-hashadapu
Community Support
Community Support

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.

v-hashadapu
Community Support
Community Support

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.

Greg_Deckler
Super User
Super User

@zamursaz No.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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