No need to filter within the window function if you use subquery or CTE, which is supported everywhere.