Data Model in Excel (A Complete Guide)

 

Download Practice Workbook


What Is a Data Model in Excel?

The Excel Data Model is a special kind of data table where two or more tables are connected based on common fields or identifier keys. In the data model, the word “Model” describes how each table is related. Linking data this way is typically done through a common column.


How to Create an Excel Data Model Using Relationship Toolbar

  • Select the first dataset.
  • Go to the Insert tab.
  • Select Table.

Inserting Table

  • Click OK in the Create Table dialog box. Make sure that the entire dataset, including the header, is selected.

Click OK in Create Table dialog box

  • Create a table for the other datasets.
  • Click on a cell of the first table.
  • Go to Table Design in the ribbon.
  • In the Properties field, type a name for the table. We put Employee_1.

Giving Name to Table

  • We set the name for the second table as Sales_1.

Giving Name to another table

  • Click on cell B5.
  • Go to the Data tab and select Relationships.

Selecting Relationship Tool to Create Data Model in Excel

  • In the Manage Relationships dialog box, click on New.

Clicking New in Manage Relationships dialog box

  • In the Create Relationship dialog box, select Worksheet Table: Sales_1 in the Table field.
  • Select Worksheet Table: Employee_1 for Related Table.
  • Select ID in the Column and Related Column.
  • Press OK to confirm.

Selecting Item in Create Relationship Dialog Box

  • In the Manage Relationships dialog box, click Close.

clicking on Close

  • Go to the Insert tab and click on Pivot Table.
  • Select From External Data Source.

Selecting External Data Source

  • Click on Choose Connection in the PivotTable from an external source window.

Click on Choose Connection

  • In the Existing Connections dialog box, go to the Tables tab.
  • Click on Tables in Workbook Data Model.
  • Click Open.

Creating Connections

  • Select New Worksheet and click OK.

Selecting New Worksheet

  • From PivotTable Fields, select Employee from the Employee_1 table, then drag it to the Rows.
  • Select Sales from the Sales_1 table and drag it to Values.
  • You will see the Data Model after pressing Update.

Created Data Model in Excel


How to Create Data Model Using Excel Power Pivot

  • Following the steps described above, we created the following two Tables.
  • Click on cell B5, go to the Power Pivot tab, and click on Add to Data Model.

Selecting Add to Data Model from Power Pivot to Create Data Model in Excel

  • From the View tab, select Diagram View.

Selecting Diagram View

  • Go to the Home tab, select the PivotTable group, then choose PivotTable.

Selecting pivot Table

  • In the Create PivotTable dialog box, select New Worksheet and click OK.

Click on New Worksheet

  • In the PivotTable Fields menu, select Employee from the Employee_1 table and drag it to Rows.
  • Select Sales from the Sales_1 table and drag it to Values.
  • Press Update and you can see the Data Model.

Data Model in Excel


How to Create Data Model Using Power Query in Excel

  • Following the steps from Method 1, we created and named two Tables.
  • Click on cell B5, go to the Data tab, and click on From Table/Range (in Get & Transform Data).

Selecting From Table Range to Create Data Model in Excel

  • In the Power Query Editor window, go to Home.
  • Select Close & Load and click on Close & Load To.

Selecting Close and Load To

  • In the Import Data dialog box, select Only Create Connection.
  • Mark Add this data to the Data Model and click OK.

Selecting items from Import Data dialog box

  • Go to the Data tab and click on Manage Data Model.

Selecting Data Model

  • Go to the Home tab, select View, and choose Diagram View.

Selecting Diagram View

  • Go to the Insert tab, select Pivot Table, and choose From Data Model.

Selecting From Data Model

  • In the PivotTable from Data Model dialog box, check New Worksheet and click OK.

Selecting New Worksheet

  • In the PivotTable Fields menu, select Employee from the Employee_1 table and drag it to Rows.
  • Select Sales from the Sales_1 table and drag it to Values.
  • Press Update to finish the Data Model.

Created Data Model in Excel


Data Model in Excel: Knowledge Hub


Things to Remember

  • We can examine the information from multiple tables together by using the data model. When we establish connections within the data model, we eliminate the need for using VLOOKUP, SUMIF, INDEX, and MATCH functions.
  • Data models are automatically created when importing datasets into Excel from external sources. If we import related tables with primary and foreign key relationships, we can automatically generate table connections.
  • When creating relationships, the columns we connect in tables should have the same type of information.
  • With pivot tables that are created using the data model, we can add slicers and use them to filter the data in pivot tables based on any field we want.

Data Model in Excel: Knowledge Hub


<< Go Back to Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Afia Kona
Afia Kona

Afia Aziz Kona, a graduate of Civil Engineering from Khulna University of Engineering & Technology, Bangladesh, serves as a technical content creator in the ExcelDemy project. Possessing a passion for innovation and critical thinking, she actively embraces challenges. Beyond her engineering background, Afia exhibits a keen interest in Excel, having authored numerous articles on Excel & VBA-related issues to simplify the experience for users facing obstacles in Excel. Apart from creating Excel tutorials, she is also... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo