Data Model in Excel (A Complete Guide)

Get FREE Advanced Excel Exercises with Solutions!

In this article, we will discuss and show how you can use and create a data model in Excel. We will go through some easy techniques to do the task.

With Excel’s data model, you can import and connect data from multiple sources, such as databases, external files, or other Excel worksheets, and create relationships between the tables based on common fields or keys. This enables you to work with large datasets and perform powerful calculations and analyses.

So let’s dive into the following article to get a comprehensive understanding of the Excel data model.


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 to each other using shared data. In the data model, the word “Model” describes how each table is related. To link the data, you can tell Excel to use a common column.

We make a single table that can access data from all the tables in the Data Model. We do this by putting together tables with data from different sheets or sources.


How to Create an Excel Data Model Using Relationship Toolbar

In this section, we will create a data model using the relationship toolbar.

  • We will select the first dataset >> go to the Insert
  • Then, select Table.

Inserting Table

  • Click OK in the Create Table dialog box.

Click OK in Create Table dialog box

  • Similarly, we created a table for another dataset as well.
  • Click on a cell of the first table >> go to the Table Design.
  • From Properties, type a name for the table.
  • Here, we typed 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 >> select Relationships.

Selecting Relationship Tool to Create Data Model in Excel

In the Manage Relationships dialog box >> click New.

Clicking New in Manage Relationships dialog box

  • Then, in the Create Relationship dialog box, select Worksheet Table: Sales_1 in the Table.
  • Select Worksheet Table: Employee_1 in the Related Table.
  • Select ID in the Column and Related Column.

Selecting Item in Create Relationship Dialog Box

  • After that, in the Manage Relationships dialog box, click Close.

clicking on Close

  • Go to the Insert tab >> click on Pivot Table >> select From External Data Source.

Selecting External Data Source

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

Click on Choose Connection

  • In the Existing Connections dialog box >> click Tables.
  • Click on Tables in Workbook Data Model.
  • Click Open.

Creating Connections

  • Select New Workbook >> click OK.

Selecting New Worksheet

  • From the PivotTable Fileds, select Employee from the Employee_1 table, and drag it to the Rows.
  • Select Sales from the Sales_1 table, and drag it to the Values.

Therefore, you can see the Data Model.

Created Data Model in Excel


How to Create Data Model Using Excel Power Pivot

Here, we will create a data model using Power Pivot.

  • Following the steps described above, we created the following two Tables.
  • Click on cell B5 >> go to the Power Pivot tab >> 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

  • Then, go to the Home tab >> from the PivotTable group >> select PivotTable.

Selecting pivot Table

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

Click on New Worksheet

  • From the PivotTable Fileds, select Employee from the Employee_1 table, and drag it to the Rows.
  • Select Sales from the Sales_1 table, and drag it to the Values.

Therefore, you can see the Data Model.

Data Model in Excel


How to Create Data Model Using Power Query in Excel

In this section, we will describe how you can create a data model using Power Query.

  • Following the steps described above, we created the following two Tables.
  • Click on cell B5 >> go to the Data tab >> click on From Table/Range.

Selecting From Table Range to Create Data Model in Excel

  • In the Power Query Editor window, go to Home.
  • Then, select Close & Load >> 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 >> click OK.

Selecting items from Import Data dialog box

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

Selecting Data Model

  • Then, go to the Home tab >> from the View group >> select Diagram View.

Selecting Diagram View

  • Now, go to the Insert tab >> select Pivot Table >> select From Data Model.

Selecting From Data Model

  • Then, in the PivotTable from Data Model dialog box >> click on New Worksheet >> click OK.

Selecting New Worksheet

  • From the PivotTable Fields, select Employee from the Employee_1 table, and drag it to the Rows.
  • Select Sales from the Sales_1 table, and drag it to the Values.

Therefore, you can see 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 we import 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.

Conclusion

This article states the uses and ways to create a Data Model in Excel. This article explains the topic in detail, and we believe you thoroughly understand the topic.

Here, we presented how to create a Data model using the Relationship toolbar, using Power Pivot, and Using Power Query. Thank you for reading this article. We hope you find this article beneficial. If you have any queries or suggestions, please let us know in the comment section.


Data Model in Excel: Knowledge Hub


<< Go Back to Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.

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