# Parent Level Calculations

### How are the metrics of parent bar calculated:

1. **Start Date** - Earliest start date of all its child bars
2. **End Date** - Latest end date of all its child bars
3. **Progress** - Refer to the below explanation:

Parent bar progress is the sum of its every child bar's product of duration and progress, divided by the sum of all its child bars duration:

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FR8zDf7NV54HuQUYMNkFD%2Fimage.png?alt=media&#x26;token=426dad3d-65fd-474d-abf4-8649a46ee2a9" alt="" width="375"><figcaption><p><em>Image 1: Parent bat progress</em></p></figcaption></figure>

{% hint style="info" %}

* d is the duration of child bar
* p is the progress of the child bar
  {% endhint %}

Example:

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FnMZHGnkT3LC8un26NTQh%2Fimage.png?alt=media&#x26;token=405b1a86-111b-40f8-be76-0ea45f163e93" alt=""><figcaption><p><em>Image 2: Example</em></p></figcaption></figure>

4. **Data label (numeric) -** Select the aggregation in Number formatting -> Data\_label\_column\_name Aggregation Type option. It provides a dropdown to select the aggregation for numeric values in data labels.
   1. $$Sum= Σd$$
   2. $$Average= Σdl/n$$
   3. Parent bar data label of weighted average type is the sum of its every child bar's product of duration and data label value, divided by the sum of all its child bars duration.$$Weighted Average = (Σ(d x dl))/Σd$$

Where n is number of child bars, d is the duration of child bar, dl is the data label value of the child bar.

{% hint style="info" %}
Read about: [Aggregation Type](https://docs.xviz.com/project-management/parent-level-calculations/aggregation-types)
{% endhint %}
