not with the groupby() function of DataFrames.
But you could with SplitApllyCombine group()
julia> using SplitApplyCombine
julia> df = DataFrame(date = Date(2024,12,29): Day(1):Date(2025,1,5))
8×1 DataFrame
Row │ date
│ Date
─────┼────────────
1 │ 2024-12-29
2 │ 2024-12-30
3 │ 2024-12-31
4 │ 2025-01-01
5 │ 2025-01-02
6 │ 2025-01-03
7 │ 2025-01-04
8 │ 2025-01-05
julia> group( yearmonth, df.date)
2-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Vector{Date}}
(2024, 12) │ [Date("2024-12-29"), Date("2024-12-30"), Date("2024-12-31")]
(2025, 1) │ [Date("2025-01-01"), Date("2025-01-02"), Date("2025-01-03"), Date("…
julia> group(yearmonth, month, df.date)
2-element Dictionaries.Dictionary{Tuple{Int64, Int64}, Vector{Int64}}
(2024, 12) │ [12, 12, 12]
(2025, 1) │ [1, 1, 1, 1, 1]
julia> group(year, month, df.date)
2-element Dictionaries.Dictionary{Int64, Vector{Int64}}
2024 │ [12, 12, 12]
2025 │ [1, 1, 1, 1, 1]