Pivot tables have a built-in feature to group dates by year, month, and quarter.
The count displayed represents the number of records per month for each color.
Fields
The source data contains three fields:Date,Sales, andColor.
Only two fields are used to create the pivot table:DateandColor.
TheColorfield has been added as a Row field to group data by color.
Then add the Year field to the pivot table directly.