Create new column with first row of each id

Hi ,
i want to create a new column with the first row of each id . this is the data i have

df = DataFrame()
df.id = repeat(1:3,3)
df.x1 = 1:9
df.x2 = 10:18
sort!(df,:id)

i want column x3 as first row of each id in column x1

9×4 DataFrame
 Row │ id     x1     x2     x3    
     │ Int64  Int64  Int64  Int64 
─────┼────────────────────────────
   1 │     1      1     10      1
   2 │     1      4     13      1
   3 │     1      7     16      1
   4 │     2      2     11      2
   5 │     2      5     14      2
   6 │     2      8     17      2
   7 │     3      3     12      3
   8 │     3      6     15      3
   9 │     3      9     18      3

Thanks

julia> transform!(groupby(df, :id), :x1 => first)
9×4 DataFrame
 Row │ id     x1     x2     x1_first 
     │ Int64  Int64  Int64  Int64    
─────┼───────────────────────────────
   1 │     1      1     10         1
   2 │     1      4     13         1
   3 │     1      7     16         1
   4 │     2      2     11         2
   5 │     2      5     14         2
   6 │     2      8     17         2
   7 │     3      3     12         3
   8 │     3      6     15         3
   9 │     3      9     18         3
1 Like