To calculate weighted total completion percent as it's shown at the second screenshot above, please, do the following steps:
- Go to menu Tools and select option Custom Fields

- Click on 'New' button in 'Edit custom fields' window

- Enter 'Earned Hours' into Title field in 'Edit Custom Field' window

- Select 'Duration' in Type Field in 'Edit Custom Field' window

- Uncheck 'Required' option in 'Edit Custom Field' window

- Enter the below formula into 'Formula:' filed in 'Edit Custom Field' window and click 'OK' button
ToFloat(ToString($estimated_time)) * $complete/100

- Click on 'New' button in 'Edit custom fields' window

- Enter 'Total % Complete' into Title field in 'Edit Custom Field' window

- Select 'Float' in Type Field in 'Edit Custom Field' window

- Uncheck 'Required' option in 'Edit Custom Field' window

- Enter the below formula into 'Formula:' filed in 'Edit Custom Field' window
$cf_earned_hours/ToFloat(ToString($estimated_time))*100

- Enter '#0.00 %' into 'Display Format:' field in 'Edit Custom Field' window and click 'OK' button

- Click 'OK' button in 'Edit custom fields' window

- Go to View menu, select option Columns, select option Task Tree Columns and activate option 'Earned Hours'

- Go to View menu, select option Columns, select option Task Tree Columns and activate option 'Total % Complete'

- Go to Task Tree tab

- Right click on a task group (ex.: 'Projects') and select option 'Custom fields options'

- Select 'Earned Hours' field in 'Edit custom field options for 'Projects' window

- Select 'Subgroups&Tasks' option in 'Settings For:' field in 'Edit custom filed options for 'Projects' window

- Select 'Enable' option in 'Field: Earned Hours' in 'Edit custom field options for 'Projects' window

- Select 'Sum' and 'Earned Hours' in drop down lists in option 'Aggregated (for taskgroup)'

- Select 'This task group' option in 'Settings For:' field in 'Edit custom field options for 'Projects' window

- Select 'Enable' option in 'Field: Earned Hours' in 'Edit custom field options for 'Projects' window

- Select 'Sum' and 'Earned Hours' in drop down lists in option 'Aggregated (for taskgroup)'

- Select 'Total % Complete' option in 'Edit custom field options for 'Projects' window

- Select 'Subgroups&Tasks' option in 'Settings For:' field in 'Edit custom field options for 'Projects' window

- Select 'Enable' option in 'Field: Total % Complete' in 'Edit custom field options for 'Projects' window

- Select 'Calculated by custom field formula (for taskgroup)' in 'Edit custom field options for 'Projects' window

- Select 'This task group' option in 'Settings For:' field in 'Edit custom field options for 'Projects' window

- Select 'Enable' option in 'Field: Total % Complete' in 'Edit custom field options for 'Projects' window

- Select 'Sum' and 'Total % Complete' in drop down lists in option 'Aggregated (for taskgroup)'

- Click 'OK' button in 'Edit custom field options for 'Projects' window