Greg_Deckler's avatar
Greg_Deckler
Community Champion
5 years ago

Near

OK, this one demonstrates changing the bubble size based upon finding the points that are nearest to you. Could be handy.

Near 1 = 
  VAR __radius = 5
  VAR __x1 = MAX('Table'[X])
  VAR __y1 = MAX('Table'[Y])
  VAR __id = MAX('Table'[ID])
  VAR __Table = ADDCOLUMNS(FILTER(ALL('Table'),[X]<=__x1+__radius && [X]>=__x1-__radius && [Y]<=__y1+__radius && [Y]>=__y1-__radius),"Distance",SQRT( (__x1 - [X])^2 + (__y1 - [Y])^2) )
RETURN
  COUNTROWS(FILTER(__Table,[Distance]<=__radius))


Near 2 = 
VAR __radius = 5
VAR __x1 = MAX('Table'[X])
VAR __y1 = MAX('Table'[Y])
VAR __id = MAX('Table'[ID])
VAR __Table = FILTER(ALL('Table'),[X]<=__x1+__radius && [X]>=__x1-__radius && [Y]<=__y1+__radius && [Y]>=__y1-__radius)
RETURN
COUNTROWS(__Table)

No RepliesBe the first to reply