I'm confused by your code not corresponding to your example data.
However, using the latter:
; with cte as (Select 1 as [number], 'A100' as [partner], 5 as [row]
Union all select 2,'A100', 5
Union all select 3 ,'A100', 5
Union all select 4 ,'A200', 28
Union all select 5 ,'A200', 28
Union all...