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