# Add a calculation

{% hint style="info" %}
User permission: Manage Custom Statements
{% endhint %}

The calculations you see on the **Edit statement** tab of the **Manage statements** screen display as white rows in the statement grid.&#x20;

Calculations can be basic formulas that refer to groups or other calculations in the statement. They can also be more complex formulas that include [functions](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations/functions-for-profit-and-loss-calculations.md), used to calculate [financial ratios](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations/financial-statements-formulas-for-common-ratios.md) (such as Days in Period), refer to statistical streams, and include groups from Balance Sheets.

You can add new calculations, edit existing calculations and delete calculations you no longer need.

For example, suppose you want to view the gross profit margin in your Profit and Loss statement. You can achieve this by adding a calculation.

### Add a calculation to a statement

1. Click the **Add** button where you want to insert the new calculation and select **Calculation**.\
   Alternatively, click an item's menu button (three dots), then select **Insert row above** or **Insert row below**, and select **Calculation**.
2. Enter a name for the calculation.

   <figure><img src="/files/rscsFFsT2ZmhYjDUtflU" alt=""><figcaption></figcaption></figure>
3. Enter the calculation formula:
   1. Click in the calculation box to activate it.
   2. Enter mathematical symbols and reference to other items in the statement to build your formula. To refer to a group or calculation, click that item's colored button to automatically insert it into the formula.
   3. Use the inbuilt [functions](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations/functions-for-profit-and-loss-calculations.md) and standard [financial ratio formulas](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations/financial-statements-formulas-for-common-ratios.md) as required.
4. Change the default **format** of the calculation result, if required. You can select from a list of default formatting options or create your own custom formatting.
5. Edit its [**Style**](#set-the-style-of-an-item) settings as required.

{% embed url="<https://phocassoftware.wistia.com/medias/jxr0vk4jju>" %}
Reference a single account code in calculations
{% endembed %}

{% embed url="<https://phocassoftware.wistia.com/medias/h27nwl52xt>" %}
Add a custom calculation to your Income Statement
{% endembed %}

{% hint style="success" %}
Watch these other videos:

* Phocas Demo: [Financial ratios](https://www.phocassoftware.com/watch-demo/financial-ratios?autoplay=true)
* PUG Training: [Ratios and statistical streams](https://www.phocassoftware.com/customer/training-series/financial-statements#session3)
  {% endhint %}

### Add a calculation to a dashboard

Just like the other rows in a financial statement, you can [add calculations to your dashboard](/financial-statements/using-statements/add-financial-analysis-to-a-dashboard.md). They can be in the grid view or chart. This is a handy way to keep track of KPIs and other ratios.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.phocassoftware.com/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
