How to add sub-affiliates count at home screen

If you want to add sub-affiliates count at affiliate panel home screen, you need to edit the file period_stats.stpl.
In the Theme editor (Merchant panel > Configuration > Design) in the "Affiliate panel theme" find and edit: '

You can add here subaffiliates counts by elements:
Number of subaffiliates on visible tiers for affiliate:

{$todaySubaffiliatesCount|number_span} - today subaffiliates count

{$thisMonthSubaffiliatesCount|number_span} - this month subaffiliates count

{$last30DaysSubaffiliatesCount|number_span} - last 30 days subaffiliates count

{$subaffiliatesCount|number_span} - subaffiliates count

Number of direct subaffiliates:

{$todayDirectSubaffiliatesCount|number_span} - today direct subaffiliates count

{$thisMonthDirectSubaffiliatesCount|number_span} - this month direct  subaffiliates count

{$last30DaysDirectSubaffiliatesCount|number_span} last 30 days direct  subaffiliates count

{$directSubaffiliatesCount|number_span} - direct subaffiliates count

For example you can add at the end of period_stats.stpl this code for adding subaffiliates counts:
<table width="600" class="StatsSummaries">
  <tr class="gray" >
    <td class="white" width="20%"></td>
    <td align="center" >##Today##</td>
    <td align="center" >##This month##</td>
    <td align="center" >##All##</td>
  <tr class="light" >
    <td class="white" width="20%">Subaffiliates</td>
    <td align="center" >{$todaySubaffiliatesCount|number_span}</td>
    <td align="center" >{$thisMonthSubaffiliatesCount|number_span}</td>
    <td align="center" >{$subaffiliatesCount|number_span}</td>

Affiliate panel home screen will look so: