> For the complete documentation index, see [llms.txt](https://docs.milientsoftware.com/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.milientsoftware.com/help/projects/profit-factor/calculated-profit-factor.md).

# Calculated profit factor

## Configuration

To configure the calculated profit factor the feature for this must be enabled. The feature is listed in the Modules section under Setup / Settings / General.

<figure><img src="/files/BjroPaqRVxKts1W11NDd" alt=""><figcaption></figcaption></figure>

By activating the feature (remember to save), a new menu item will be available in the left panel in Setup / Settings / Projects.&#x20;

<figure><img src="/files/UGORyOIe30UkkiuJ91yb" alt=""><figcaption></figcaption></figure>

Select "Calculated" and save this selection to get started.

## Visualization

The profit factor is shown in a few places when this has been done.

#### Project

On the project main page, the profit factor is shown at the bottom of the first left section. The value is shown as - if not yet calculated or a number when calculated. To calculate it on demand, click on the calculator icon next to the value.

<figure><img src="/files/3nc3JJYIfqqjxjfJ8t3c" alt=""><figcaption></figcaption></figure>

#### Project Report

In the project report, there is the option to enable/show a column with the calculated profit factor. The value shown is the latest calculated value.

<figure><img src="/files/luiEO71MDX993PcSF7sY" alt=""><figcaption></figcaption></figure>

## Calculation

The triggering of the calculation of the profit factor is done in a few different ways. All of these will calculate in the same way.

* On demand\
  The calculation can be done at any time from the main page of the project by clicking the afore mentioned calculator icon.
* For all projects\
  All projects can be calculated at once using a tool. The tool is located under Setup / Tools / Main. \
  The section named "Set all project in company" is used for this purpose. Click on "Run" to execute the calculations.<br>

  <figure><img src="/files/CBkthbq6mczzuljUOn82" alt=""><figcaption></figcaption></figure>
* Scheduled\
  In addition to these two manual methods of calculation, there is an automated solution in place that is running on a scheduler. This is executed once per day, at midnight, at this time all projects will be updated based on any new registrations of hours or expenses made during the day.&#x20;

## Values calculated

The data taken into account when calculating the profit factor are the hours registered in the project, and the expenses registered in the project that are linked to a supplier.&#x20;

The calculation uses the summarized values for each of hours invoice value and cost as well as expense value.

### Hours

For each hour registered, the hourly rate is multiplied with time registered. The total of this is *HoursTotalValue*.

For each hour registered, the total cost is multiplied with time registered. The total of this is *HoursTotalCost*.

### Expenses

All supplier expenses summed up is *SupplierExpenseTotalValue*.

### Formula

To get the profit factor these values are calculated using this formula:

$$
HoursTotalValue - SupplierExpenseTotalValue / HoursTotalCost
$$
