diff --git a/climax/core/dataset.py b/climax/core/dataset.py
index 71246d2b47deaa69133ac6bf96a1829c1e8666a6..83b4dc8ce22505b1279d0a3361b3603ddf72efe0 100644
--- a/climax/core/dataset.py
+++ b/climax/core/dataset.py
@@ -237,7 +237,7 @@ class EoDataset(torch.utils.data.Dataset):
     def anomalies(ds, timescale='time.dayofyear', standard=False):
         # group dataset by time scale
         LOGGER.info('Computing anomalies ...')
-        groups = ds.groupby('time.dayofyear').groups
+        groups = ds.groupby(timescale).groups
 
         # compute anomalies over time
         anomalies = {}