> 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-visual-column/rollup-column.md).

# Rollup Column

A rollup column aggregates values from related records in a linked table and displays the aggregated result in the current table. Use rollup columns to calculate values such as **sum**, **count**, **average**, **minimum**, **maximum**, **median**, **earliest date**, **latest date**, **countA**, **empty**, and more.

### Use cases of rollup column

You can use a rollup column to

* Display the total hours logged for a project.
* Show the number of open tasks assigned to an employee.
* Calculate the total value or quantity of orders for a product or customer.
* Display the latest or earliest order date for a product.

A rollup column is similar to a [reference column](/powertable-sheets/how-tos/adding-columns-overview/add-visual-column/reference-column.md) but also automatically calculates aggregated values from related records. This eliminates the need to manually maintain summary values across multiple tables. When data in the linked table changes, the rollup value is recalculated automatically.

This article explains how to create and configure a rollup column by using a sample **Products** table.

In this example, you create:

* A rollup column that displays the **total order quantity** for each product.
* A rollup column that displays the **latest order date** for each product.

### Add a rollup column

1. Go to **PowerTable** > **Insert Column** > **Visual Column** > **Add Roll Up Column**. A side panel opens.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FddeoC8yztSz0kchNSiDj%2Fimage.png?alt=media&amp;token=4358dcf7-8f1c-4c94-8c27-d02c479200e2" alt=""><figcaption></figcaption></figure>

2. Configure the following details:

* **Column Name**: Enter an appropriate name for the rollup column, such as *Total Orders*.
* **Schema**: Select the schema that contains the linked table.
* **Linking Table**: Select the table that contains the records to aggregate.
* **Column from Current Table**: Select the column in the current table used to match records.
* **Column from Linking Table**: Select the matching column in the linked table. In this example, *ProductKey* is the matching column.
* **Column To Rollup**: Select the column to aggregate. Here, choose *OrderQuantity* as the column to roll up.
* **Aggregation**: Select an aggregation function, such as **Sum**, **Average**, or **Count**. Use **Sum** to add and aggregate the order quantities for each product.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FOTy8yEI0d4a0N9RhH8EE%2Fimage.png?alt=media&amp;token=c02e1b4c-8b3f-49ee-8440-c5b33afd6955" alt=""><figcaption></figcaption></figure>

3. **If Condition**: Optionally, add one or more filter conditions by using **Add Filter** to aggregate only the records that meet specific criteria. Combine multiple conditions by using **AND** or **OR**. For example, you can aggregate only the orders placed after a specific date by filtering on the **OrderDate** column.
4. The display properties for the rollup column can be configured in the panel's **Display** tab. To learn more, see [Display](/powertable-sheets/how-tos/configure-column-properties/display.md).
5. Select **Save**.

A rollup column that displays the aggregated order quantity for each product is added based on the matching product key.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2Fj8oIst8wnFfg6ODf73Z7%2Fimage.png?alt=media&amp;token=c9d63195-a1e1-41a0-be2d-51a262facf11" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

### Note

Products with no related records or no values to aggregate display a blank value in the rollup column.
{% endhint %}

### Another example

To create another rollup column that displays the latest order date, repeat the same steps. Select **Order Date** as the column to roll up, and select **Latest Date** as the **Aggregation** type. Select **Save**.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2F2TiPzbNmGJbq76G9KLjD%2Fimage.png?alt=media&amp;token=3461cf0b-ce4b-412f-9ed3-f221774511f4" alt="" width="563"><figcaption></figcaption></figure>

The latest order date rollup column is added, as shown in the following image.

<figure><img src="https://257222532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUtolck8kt8atqxFPsEBn%2Fuploads%2FGbMJTCTWvjBGCGlysLza%2Fimage.png?alt=media&amp;token=fe8b45a4-f6c2-4817-814c-d68df065b38e" alt=""><figcaption></figcaption></figure>


---

# 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-visual-column/rollup-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.
