private function setPastTotalVisitsMetadata($dataTable, $pastTable)
    {
        if ($pastTable instanceof DataTable) {
            $total  = 0;
            $metric = 'nb_visits';

            $rows = $pastTable->getRows();
            $rows = $this->filterRowsForTotalsCalculation($rows);

            foreach ($rows as $row) {
                $total += $row->getColumn($metric);
            }

            $dataTable->setMetadata(self::getTotalMetadataName($metric . '_lastdate'), $total);
        }
    }