I created a sample fiddle for this SQLFIDDLE
CREATE TABLE [dbo].[Users](
[userId] [int] ,
[userName] [varchar](50) ,
[managerId] [int] ,
)
INSERT
Try this. Filter has to be applied in the Anchor query
of CTE
WITH UserCTE
AS (SELECT userId,
userName,
managerId,
0 AS EmpLevel
FROM [Users]
WHERE managerId = 3
UNION ALL
SELECT usr.userId,
usr.userName,
usr.managerId,
mgr.[EmpLevel] + 1
FROM [Users] AS usr
INNER JOIN UserCTE AS mgr
ON usr.managerId = mgr.userId
WHERE usr.managerId IS NOT NULL)
SELECT *
FROM UserCTE AS u
ORDER BY EmpLevel;