# Fact Entities

In a dimensional model, a fact entity represents a database table that contains quantitative information regarding a business process, such as measures and metrics. It is the central entity of a star schema and is surrounded by related dimension entities. This implies that the primary key of each dimension table is also part of the fact table as a foreign key.

## **Video**

{% embed url="<https://youtu.be/Ug2o6-GE0pE>" %}

## **Overview**

Let’s assume that we have a sample dimensional model that looks like this:

![](/files/X8QCwKksgBlbb7RomBtE)

The *Sale* entity in this model represents the fact table and is surrounded by numerous dimension entities in the star schema.

In the next sections of this article, we’ll examine the layout of the *Sale* entity to learn how you can configure facts in Astera Data Stack.

**Layout Builder**

To open the properties of the fact entity, right-click on it and select *Properties* from the context menu.

![](/files/wmiecJ1MqrEFhuwOngIX)

A configuration window will appear. This window provides the same options as it does for a general entity, the only addition being the *Fact Role* column on the *Layout Builder* screen. To learn more about the general entity properties, click [here](/astera-data-stack-v9/data-model/data-models/general-entity-properties.md).

On the first screen, you can view and edit some general information regarding the table, including its name, schema, and type.

![](/files/nocyzX2RDsHpfZ3oDOj7)

Click *Next* to proceed to the *Layout Builder* screen.

![](/files/F2sbbRqS00qjD0I2eEYQ)

### **Foreign Keys**

In the layout of this fact table, you’ll notice quite a few foreign keys, such as *City\_Key*, *Customer\_Key*, etc.

![](/files/SBwHy88eJ7dza7sm9twU)

Each of these foreign keys represents a relationship between this fact table and one of the dimension tables. For example, *City\_Key* represents the primary key of the *City* table, *Customer\_Key* represents the primary key of the *Customer* table, and so on.

### **Fact Role**

The *Fact Role* column in the layout builder provides a dropdown menu for you to assign the role of *Transaction Date Key* to one of the fields.

![](/files/tYGGCscHNRpomN10eLxH)

*Transaction Date Key*: A key date field that is coming from the OLTP system.

![](/files/JlIJhuwhLzZfTqarVgsf)

{% hint style="info" %}
**Note**: Assigning the *Transaction Date Key* fact role to more than one field in a fact entity will cause a verification error in the model.
{% endhint %}

In this case, we’ve assigned the role to the Invoice\_Date\_Key field.

Once you’ve assigned the *Transaction Date Key* role to a field, click *OK*.

This concludes our discussion on fact entities in Astera Data Stack.


---

# 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://documentation.astera.com/astera-data-stack-v9/data-model/dimensional-modelling/fact-entities.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.
