query to find the count of each member in a column Imagine there is a table with these columns

Table 1 : id
          Name
          Family


We want to find the count of each member in the column .
I wrote the query with CTE but I want to know if there are better solutions
in the picture below you can see the query and the result.
One way is to use COUNT() with OVER :

declare @vt_source as table
( id int not null,
  name varchar(50) not null)

 insert into @vt_source(id,name)
 values (1,'pantea')
 ,(1,'pantea')
 ,(2,'shidea')

 select distinct
    id
    ,name
    ,count(*)over(partition by id 
                       order by name asc 
                       ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as idCount
    ,count(*)over(partition by name 
                       order by id asc 
                       ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as nameCount
 from
   @vt_Source


output:

id  name    idCount nameCount
1   pantea  2       2
2   shidea  1       1


EDIT:
as @Lennart sugested, the count part can be rewritten like this:

,count(*)over(partition by id) as idCount
,count(*)over(partition by name) as nameCount