A SELECT query is logically evaluated in this order: FROM-JOIN-WHERE-GROUP BY-HAVING-SELECT-ORDER BY. Thus, something you define in the SELECT list cannot be used in the WHERE clause. (But it can be used in ORDER BY).
The way to resolve this issue is to use nested queries. This is often done with Common Table Expressions (CTE). For instance:
; WITH numbering AS (
select [PlanID]
,[SubSystemId]
,[Cat3]
,[factor]
,[ValidFrom]
,row_number() over(partition by [PlanID], [SubSystemId] ,[Cat3]
order by [ValidFrom] desc) as rn
from DB.[dbo].[sometable] as T
)
SELECT *
FROM numbering
WHERE rn = 1