As @Saddles pointed out in the comments, the WHERE clause should go before the lablel like this =QUERY(earnings!A:J, "SELECT A, B, C, YEAR(C), toDate(C) where A = 'Brooklyn' label YEAR(C) 'Year', toDate(C) 'Month' format toDate(C) 'MMM'", 1)
WHERE
=QUERY(earnings!A:J, "SELECT A, B, C, YEAR(C), toDate(C) where A = 'Brooklyn' label YEAR(C) 'Year', toDate(C) 'Month' format toDate(C) 'MMM'", 1)