> 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/create-slowly-changing-dimensions.md).

# Create slowly changing dimensions

Use Type 2 and Type 3 slowly changing dimensions (SCDs) to track changes to dimension data. In this article, you learn how to configure each SCD type and understand how they preserve historical and current attribute values. To know more about SCDs, see [slowly changing dimensions](/documentation/readme/powertable-sheets/concepts/type-2-scds.md).

### Prerequisites

The source data used to populate a type 2 slowly changing dimension must have the following columns:

* A natural key such as region ID, customer ID, or product ID.
* A unique sequence number that will be used as the surrogate key.
* Two date columns that capture the start and end dates.
* A boolean column that indicates whether a record is active.

The source data used to populate a Type 3 SCD must include a corresponding history column for each column that maintains historical values.

{% hint style="info" %}
SCD configuration is available only during table creation. Existing tables cannot be converted to slowly changing dimensions after they have been created.
{% endhint %}

### Configure type 2 SCD

Slowly changing dimensions are configured during table creation. In this example, you create an SCD table using data imported from an Excel file.

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

1. In the table configuration, turn on **Enable support for Slowly Changing Dimensions (SCD)** and select **Type-2.**

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

2. Map the source columns to the surrogate key, natural key, active flag, and date range fields. Use **End Date Default Value** to define the default end date for active records. Choose either a null value or an infinite date.

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

3. In **SCD Columns**, select the columns whose changes you want to track in the slowly changing dimension and select **Finish**.

The table is created.

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

#### View change history

Slowly changing dimensions capture the changes made to each record.

1. Edit a cell value and select **Save to Database** to commit the change.

<figure><img src="/files/9y9d8d8iXdf1YN4MN5CR" alt=""><figcaption></figcaption></figure>

2. The original record is marked as inactive and excluded from the grid. A new record containing the updated values is inserted at the end of the grid. To view the change history for a record, select the record and then select **History**.

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

3. In the **History** pane, records with the **Active** flag enabled are the current active records. Their **End Date** is displayed as either null or an infinite date, based on the SCD configuration. After reviewing the change history, select the back icon to return to the grid.

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

### Configure type 3 SCD

You can configure Type 3 SCDs when creating a table from a file or semantic model or by manually entering data.

1. In the table configuration, turn on **Enable support for Slowly Changing Dimensions (SCD)** and select **Type-2.**

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

2. Select the current value column and its corresponding history column to track both the latest and previous values. Select **+ Add More** to maintain historical data for more than one column.&#x20;

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

3. Select **Finish** to create the table.

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

4. When you edit a value, the older value is moved to the configured history column. Select **Preview Changes**.&#x20;

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

5. Verify the changes made.

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

6. Select **Added**, **Updated**, or **Deleted** to preview records with specific changes. Select **Save to Database** to commit the changes.

<figure><img src="/files/m1r2UTx0FvURnbVCbqK2" 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:

```
GET https://docs.fabricplan.com/documentation/readme/powertable-sheets/how-tos/create-slowly-changing-dimensions.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.
