diff --git a/aleksis/apps/chronos/preferences.py b/aleksis/apps/chronos/preferences.py
index cddfb3f0c8be0fbf9f2aeeafa27fcec971a318c0..e4fc87526b2715851efb5681528e9f71da516c5e 100644
--- a/aleksis/apps/chronos/preferences.py
+++ b/aleksis/apps/chronos/preferences.py
@@ -57,3 +57,13 @@ class SubstitutionsShowHeaderBox(BooleanPreference):
     default = True
     verbose_name = _("Show header box in substitution views")
     help_text = _("The header box shows affected teachers/groups.")
+
+
+@site_preferences_registry.register
+class AffectedGroupsUseParentGroups(BooleanPreference):
+    section = chronos
+    name = "affected_groups_parent_groups"
+    default = True
+    verbose_name = _(
+        "Show parent groups in header box in substitution views instead of original groups"
+    )
diff --git a/aleksis/apps/chronos/templates/chronos/partials/groups.html b/aleksis/apps/chronos/templates/chronos/partials/groups.html
index 3622cb4166709ddb85d3941b2c205c90e8b0aa94..fb85c6d4dce53da5aea4ecef805fb52ddab4eed9 100644
--- a/aleksis/apps/chronos/templates/chronos/partials/groups.html
+++ b/aleksis/apps/chronos/templates/chronos/partials/groups.html
@@ -1,5 +1,5 @@
 {% if groups.count == 1 and groups.0.parent_groups.all and request.site.preferences.chronos__use_parent_groups %}
-  {% include "chronos/partials/groups_part.html" with groups=groups.0.parent_groups.all %}
+  {% include "chronos/partials/groups_part.html" with groups=groups.0.parent_groups.all no_collapsible=no_collapsible %}
 {% else %}
-  {% include "chronos/partials/groups_part.html" with groups=groups %}
+  {% include "chronos/partials/groups_part.html" with groups=groups no_collapsible=no_collapsible %}
 {% endif %}
diff --git a/aleksis/apps/chronos/templates/chronos/partials/groups_part.html b/aleksis/apps/chronos/templates/chronos/partials/groups_part.html
index 60980ace4499873d3cd28bedf8b8e0b1282c51ae..edafcb1977d04a18fb2a53651cf4ad6def3f0b19 100644
--- a/aleksis/apps/chronos/templates/chronos/partials/groups_part.html
+++ b/aleksis/apps/chronos/templates/chronos/partials/groups_part.html
@@ -1,4 +1,4 @@
-{% if groups.count > request.site.preferences.chronos__shorten_groups_limit and request.user.person.preferences.chronos__shorten_groups %}
+{% if groups.count > request.site.preferences.chronos__shorten_groups_limit and request.user.person.preferences.chronos__shorten_groups and not no_collapsible %}
   {% include "components/text_collapsible.html" with template="chronos/partials/group.html" qs=groups %}
 {% else %}
   {% for group in groups %}
diff --git a/aleksis/apps/chronos/templates/chronos/partials/headerbox.html b/aleksis/apps/chronos/templates/chronos/partials/headerbox.html
index 6d30df914bb580413fbaa3623cd275a0c63dc2a5..d298d5fc6faecec81be8f7fc48996cc777470290 100644
--- a/aleksis/apps/chronos/templates/chronos/partials/headerbox.html
+++ b/aleksis/apps/chronos/templates/chronos/partials/headerbox.html
@@ -23,7 +23,7 @@
             </strong>
           </div>
           <div class="col s12 m9 black-text-a">
-            {% include "chronos/partials/groups.html" with groups=absent_groups %}
+            {% include "chronos/partials/groups.html" with groups=absent_groups no_collapsible=True %}
           </div>
         </div>
       {% endif %}
@@ -47,7 +47,7 @@
             </strong>
           </div>
           <div class="col s12 m9 black-text-a">
-            {% include "chronos/partials/groups.html" with groups=affected_groups %}
+            {% include "chronos/partials/groups.html" with groups=affected_groups no_collapsible=True %}
           </div>
         </div>
       {% endif %}
diff --git a/aleksis/apps/chronos/views.py b/aleksis/apps/chronos/views.py
index c56a2e5cc76a53be131a31e2344373e156dcd4b0..82bc1616b55feef2fdff64eac7aaa15f72c7f8c2 100644
--- a/aleksis/apps/chronos/views.py
+++ b/aleksis/apps/chronos/views.py
@@ -1,7 +1,7 @@
 from datetime import datetime, timedelta
 from typing import Optional
 
-from django.db.models import Count
+from django.db.models import Count, Q
 from django.http import HttpRequest, HttpResponse, HttpResponseNotFound
 from django.shortcuts import get_object_or_404, redirect, render
 from django.urls import reverse
@@ -311,7 +311,15 @@ def substitutions(
             day_contexts[day]["absent_teachers"] = absences.absent_teachers()
             day_contexts[day]["absent_groups"] = absences.absent_groups()
             day_contexts[day]["affected_teachers"] = subs.affected_teachers()
-            day_contexts[day]["affected_groups"] = subs.affected_groups()
+            affected_groups = subs.affected_groups()
+            if get_site_preferences()["chronos__affected_groups_parent_groups"]:
+                groups_with_parent_groups = affected_groups.filter(parent_groups__isnull=False)
+                groups_without_parent_groups = affected_groups.filter(parent_groups__isnull=True)
+                affected_groups = Group.objects.filter(
+                    Q(child_groups__pk__in=groups_with_parent_groups.values_list("pk", flat=True))
+                    | Q(pk__in=groups_without_parent_groups.values_list("pk", flat=True))
+                ).distinct()
+            day_contexts[day]["affected_groups"] = affected_groups
 
     if not is_print:
         context = day_contexts[wanted_day]