#6 Microsoft Fabric: Data model – create relationships in the Lakehouse

In this article, we’ll create a star schema that you might see from data warehouses: It resembles a star. The center of the star is a Fact table. The surrounding tables are called Dimension tables, which are related to the Fact table with relationships.

Let’s get started!

1. In the workspace view, select the SQL Endpoint item named TestLH.

No alt text provided for this image

2. Once in the Explorer, select the Model view at the bottom of the screen to begin creating relationships.

No alt text provided for this image

3. Create a relationship by dragging and dropping the column CustomerKey from the FactOnlineSales table, to the CustomerKey on the DimCustomer table.

4. Once in the Create Relationship window ensure that you have selected the correct tables, columns and settings as showing in the following table. Select Confirm to continue.

No alt text provided for this image

5. Perform these same steps for each of the remaining tables and columns listed in the following table to create relationships.

No alt text provided for this image

6. Now, let’s write a basic measure that calculates the total sales amount by due date on the sales order instead of the default order date.

7. Select the FactOnlineSales table in the Tables folder. On the Home tab, select New measure.

No alt text provided for this image

8. In the formula editor, use the following measure to calculate the total sales amount. Select the check mark to commit.

Total Sales Amount = SUM(FactOnlineSales[SalesAmount])

No alt text provided for this image
Call Now