> 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/documentation/readme/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="/files/KdHa7BsS4We2BonCRZnm" alt=""><figcaption></figcaption></figure>

2. Enter the column name.
3. Enter the required formula in the formula box.&#x20;

* 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.&#x20;
* 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="/files/YjY1OzXeEzQSja4CKFHm" alt="" width="563"><figcaption></figcaption></figure>

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

<figure><img src="/files/X8f61BP9cUJa8FmlgLVS" 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="/files/Vbovfr5Yeg8pUESgr0AJ" alt="" width="563"><figcaption></figcaption></figure>

6. Select **Save**.&#x20;

The formula column is added to the table.

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

### Related content

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


---

# 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/documentation/readme/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.
