> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/powertable-sheets/how-tos/adding-columns-overview/add-formula-column.md).

# Add Formula Column

Formula columns are calculated columns created from your data that enable you to derive business-specific metrics or calculations on the go. You can add them at the visual level or directly to your source database (database column).

Common use cases for formula columns include calculating profit margins, tracking performance metrics, creating planning and forecasting calculations, generating status indicators, and building custom KPIs from existing data.

1. To insert formula columns, select **PowerTable** > **Insert Column** > **Formula Column**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FyCIdws8SImBGT02Pld3b%2Fimage.png?alt=media&amp;token=03d6404b-f0cf-4e8a-9ec2-e8241c332e12" alt=""><figcaption></figcaption></figure>

2. Enter the column name.
3. Enter the required formula in the formula box.

* When you place the cursor in the editor, a context assistant appears automatically with **Functions** and **References**. Or press **Ctrl** + **Space** to open it.
* As you type, the suggestions are automatically narrowed down.
* Use the **References** tab to find and insert available columns from the current table into the formula.
* Use the **Functions** tab to browse and insert supported functions, such as **SUM**, **MIN**, **MAX**, and **AVERAGE**, into the formula.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FSvGmyFPLvdsZlUCR0N8u%2Fimage.png?alt=media&amp;token=de1792a5-d1a8-4ef5-8267-56804859b7a8" alt="" width="563"><figcaption></figcaption></figure>

4. You can specify the currency type and the number of decimal points to display.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FhGeSQprgGytV9T1LVw9W%2Fimage.png?alt=media&amp;token=d306b126-47ad-4671-9419-7fe0218b435e" alt="" width="503"><figcaption></figcaption></figure>

5. If you want to add the formula column directly to the database, check the **Create a database column** checkbox. Then, choose the appropriate data type and attributes such as length, precision, or scale for the column in the target database.

{% hint style="info" %}

#### Note

Please ensure you have the required permissions to the database you are connected to, as you are adding a column directly to the source database.
{% endhint %}

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F549lILpTHDfHxeP9ddJt%2Fimage.png?alt=media&amp;token=73314187-db7b-411d-8a45-9702e9da857d" alt="" width="563"><figcaption></figcaption></figure>

6. Select **Save**.

The formula column is added to the table.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F7dT2xRPhesFnsqrmog4x%2Fimage.png?alt=media&amp;token=68375bc5-1d8a-4883-9968-5c55a33c0334" alt=""><figcaption></figcaption></figure>

### Related content

For more information about the available formulas and functions, you can refer to [Formula Syntax](/planning-sheets/reference/formula-syntax.md).

### FAQ

#### What does the **Expected EOL Date** formula column calculate?

The **Expected EOL Date** formula column adds the asset's expected lifetime to its purchase date to calculate the end-of-life date.

It uses the following formula:

`DATEADD([Purchase Date], (365 * [Expected Lifetime In Years]))`

For example, if the expected lifetime is **3 years**, the formula adds **1,095 days** to the **Purchase Date**.

#### Why can't I paste the formula?

Pasting a formula isn't supported. PowerTable resolves column references as you type, and pasted text doesn't preserve those references.

Type the formula manually, and use **Ctrl+Space** to insert each column reference instead of typing the bracketed column name as plain text.

#### Does the formula column get written to the database?

The formula column is written to the database only if you select **Create a database column** in the **Add Formula Column** dialog.

If you don't create a database column, the formula column still persists in the PowerTable sheet. When you reopen the sheet, the formula column remains available, and its values are recalculated based on any changes to the underlying data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fabricplan.com/powertable-sheets/how-tos/adding-columns-overview/add-formula-column.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
