Forum Discussion
Azure Map Point ID, Order help
- 10 months ago
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.
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.