Table1 =
VAR tb1 =
CALCULATETABLE ( VALUES ( 'Table'[ID] ), 'Table'[People] > 100 )
VAR tb2 =
ALL ( 'Table'[ID] )
VAR tb3 =
UNION ( { 0 }, EXCEPT ( tb2, tb1 ), { 100000 } )
VAR tb4 =
SELECTCOLUMNS ( tb3, "value2", [Value] )
VAR gaptable =
ADDCOLUMNS (
GENERATE ( tb3, TOPN ( 1, FILTER ( tb4, [Value2] > [Value] ), [Value2], ASC ) ),
"gap", [value2] - [Value]
)
RETURN
ADDCOLUMNS (
'Table',
"gap", SUMX ( TOPN ( 1, FILTER ( gaptable, [Value] < [ID] ), [Value], DESC ), [gap] )
> 3
)