Accesses data from a subsequent row in the same result set without the use of a self-join in SQL Server 2017. LEAD provides access to a row at a given physical offset that follows the current row. Use this analytic function in a SELECT statement to compare values in the current row with values in a following row.
For further reading https://learn.microsoft.com/en-us/sql/t-sql/functions/lead-transact-sql