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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
unknown917
Helper III
Helper III

Azure Map Point ID, Order help

I have a table with a starting point and multiple end points.  I have calculated the distance and cardinal direction from the starting point to each of the end points.  I now wish to take the most outlying points and represent them on the azure map as a polygon to visualize the territory surrounding the starting point.

 

Can anyone offer some guidance as to how to summarize, or filter, the data on the visual as to only return the single most outlying points?  Create a new table?  Or create a calculated within the existing table to get a sequence?  There are duplicates in the table as well.

 

Thank you in advance!

1 ACCEPTED SOLUTION

Hi @unknown917

 

The idea is that you want to rank the entries by distance, and then keep only the ones where rank = 1. 

Something along the lines of this: 

RankInBin =
VAR sp  = 'Table'[StartingPoint]
VAR bin = 'Table'[DirBin]
RETURN
    RANKX(
        FILTER(
            ALL('Table'),
            'Table'[StartingPoint] = sp
                && 'Table'[DirBin] = bin
        ),
        'Table'[DistanceKm],
        ,
        DESC,
        DENSE
    )

 

Next create a slim table of “farthest points” by filtering to RankInBin = 1:

OutlierPoints =
FILTER(
    'Table',
    'Table'[RankInBin] = 1
)

If you sometimes get multiple rows with the exact same max distance, add a secondary tiebreaker to the rank. One simple way is build a SortKey column and rank by that:

SortKey = 'Table'[DistanceKm] * 1000000 + (360 - 'Table'[BearingDeg]) / 1000


Then change the RANKX expression to use [SortKey] instead of DistanceKm, still DESC.

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

View solution in original post

7 REPLIES 7
v-karpurapud
Community Support
Community Support

Hi @unknown917 

I wanted to check if you’ve had a chance to review the information provided. If you have any further questions, please let us know. Has your issue been resolved? If not, please share more details so we can assist you further.

Thank You.

v-karpurapud
Community Support
Community Support

Hi @unknown917 

We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank You.

v-karpurapud
Community Support
Community Support

Hi @unknown917 

Thank you for submitting your question to the Microsoft Fabric Community Forum, and thanks to @tayloramy for offering helpful suggestions.

 

Could you let us know if the suggested solution resolved your issue?If you still need help, please share more details so we can assist you further.

Thank you.

unknown917
Helper III
Helper III

Here is an example of a failed attempt (backstory, my distance and direction calcs are measures):
 
Column = SUMMARIZE('Table',FILTER(ALL('Table','Table'[StartingPoint]<>BLANK(), 'Table',CALCULATE(DISTINCT([Cardinal Direction])), CALCULATE(MAXX('Table','Table'[Distance between points])),'Table'[StartingPoint],'Table'[Latitude],'Table'[Longitude])))

Hi @unknown917,

 

You’re basically trying to draw the “territory” around a start location. In geospatial terms, that’s a boundary around your farthest points (often approximated by selecting the farthest point in each direction and connecting them in order, or by computing a convex hull). The Azure Maps visual can show that boundary as a polygon if you give it geometry (e.g., WKT/GeoJSON) via a reference layer, or you can switch to a custom visual (like Icon Map) that accepts WKT directly.

 

Try this approach:

  1. Move “distance” and “bearing/direction” from measures to columns
    You need row-level values to rank and sort points. Create calculated columns (or do it in Power Query) for:
    • DistanceKm (Haversine)
    • BearingDeg (0–360 degrees from start > endpoint)
    • DirBin (e.g., 16 bins of 22.5° each)
  2. Pick the outliers (one per direction bin)
    Create a small table of only the farthest point per direction bin, per StartingPoint (use RANKX in DAX or a Group/Max step in Power Query). This eliminates duplicates naturally.
  3. Build the polygon (WKT) by ordering points by bearing
    Concatenate the ordered lon/lat pairs into a POLYGON((lon lat, ... , lon lat)) string (repeat the first coordinate at the end to close the ring).
  4. Show it on a map
    • Azure Maps: Add the polygon as a Reference layer (upload a CSV with the WKT column), or if your model produces WKT as a table, export it and use that CSV as the reference layer. The Azure Maps visual supports WKT/GeoJSON/KML/SHP via reference layers. See: Add a reference layer to Azure Maps.


If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

@tayloramy - I'm struggling with 2. how to create the table with the farthest points by direction, by starting point. I created a Variant table to get the data I need, but am not grasping how to use RANKX to produce a short list of lat/long by direction, by farthest point.  Any guidance would be greatly appreciated.

Hi @unknown917

 

The idea is that you want to rank the entries by distance, and then keep only the ones where rank = 1. 

Something along the lines of this: 

RankInBin =
VAR sp  = 'Table'[StartingPoint]
VAR bin = 'Table'[DirBin]
RETURN
    RANKX(
        FILTER(
            ALL('Table'),
            'Table'[StartingPoint] = sp
                && 'Table'[DirBin] = bin
        ),
        'Table'[DistanceKm],
        ,
        DESC,
        DENSE
    )

 

Next create a slim table of “farthest points” by filtering to RankInBin = 1:

OutlierPoints =
FILTER(
    'Table',
    'Table'[RankInBin] = 1
)

If you sometimes get multiple rows with the exact same max distance, add a secondary tiebreaker to the rank. One simple way is build a SortKey column and rank by that:

SortKey = 'Table'[DistanceKm] * 1000000 + (360 - 'Table'[BearingDeg]) / 1000


Then change the RANKX expression to use [SortKey] instead of DistanceKm, still DESC.

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.