Pinterest Pixel

Data Model and Relationships In Microsoft Excel Pivot Tables

Bryan
Ever had multiple related tables and wondering how to create a report that connects them together in a single Pivot Table? We have just the thing with Data Model and Relationships!

Ever had multiple related tables and wondering how to create a report that connects them together in a single Pivot Table? We have just the thing with Data Model and Relationships!

Key Takeaways

  • Combine Multiple Tables with Ease – The Excel Data Model lets you connect multiple tables without merging them into one, using defined relationships.

  • Relationships Mimic Database Joins – You can create relationships between tables using common fields (like IDs), similar to how foreign keys work in databases.

  • Power Pivot Unlocks More Power – With Power Pivot, you can build complex data models, create calculated columns and measures using DAX, and manage large datasets efficiently.

  • No Need for VLOOKUP – Instead of using formulas to combine data, relationships let Pivot Tables pull from multiple tables directly, simplifying analysis.

  • Improves Data Integrity & Scalability – The Data Model approach keeps tables clean, separate, and scalable, which is ideal for reporting and future updates.

Our Data Setup

This is our data that we will use. What we want to do is create a report that shows the First Name of the student and the Number of Classes that the student has taken.

The tricky part here is the First Name is in the Students Table, while the number of classes can be retrieved from the Classes Table. Both tables are linked by the StudentId column.

Data Model and Relationships In Microsoft Excel Pivot Tables

Data Model and Relationships In Microsoft Excel Pivot Tables

STEP 1: Select the Classes Table. Go to Insert > Pivot Table > New Worksheet 

Make sure to tick Add this data to the Data Model. Click OK.

Data Model and Relationships In Microsoft Excel Pivot Tables

 

STEP 2: Select the Students Table. Go to Insert > Pivot Table > New Worksheet 

Make sure to tick Add this data to the Data Model. Click OK.

Data Model and Relationships In Microsoft Excel Pivot Tables

 

STEP 3: Click All in PivotTable Fields and you should see both tables there.

Data Model and Relationships In Microsoft Excel Pivot Tables

 

STEP 4: Now we need to link them together! Go to PivotTable Tools > Analyze > Calculations > Relationships

Data Model and Relationships In Microsoft Excel Pivot Tables

Click New.

Data Model and Relationships In Microsoft Excel Pivot Tables

 

STEP 5: There are 2 sides of a relationship when we want to link them together.

The rule of thumb, is the primary table should have no duplicates. This is the Students table as it does not have duplicate Student Ids.

Set the following then Click OK.

Table – Classes

Column – StudentId

Related Table – Students

Related Column – StudentId

Data Model and Relationships In Microsoft Excel Pivot Tables

Click Close.

Data Model and Relationships In Microsoft Excel Pivot Tables

 

STEP 6: In the ROWS section put in the Students(FirstName) field.  In the VALUES section put in the Classes (ClassName) field.

With just that, you can see that Excel was able to show the results in a merged fashion! You can see Daisy has 2 classes enrolled. And from the individual tables, you would not have that information readily available!

Data Model and Relationships In Microsoft Excel Pivot Tables

 

Frequently Asked Questions

What is the Data Model in Excel?
It’s a built-in relational data engine that lets you connect and analyze data from multiple tables in one Pivot Table.

How do I add tables to the Data Model?
While inserting a Pivot Table, check the box “Add this data to the Data Model”, or use Power Pivot to import and manage tables.

Can I build relationships without Power Pivot?
Yes! In Excel 2013 and later, you can create relationships directly via Data > Relationships, even without using Power Pivot.

How do relationships improve my Pivot Tables?
Relationships let you analyze fields from different tables together without needing lookup formulas or manual joins.

Is the Data Model available in all versions of Excel?
The Data Model is available in Excel 2013 and later, including Excel for Microsoft 365. Power Pivot tools may require enabling the add-in.

If you like this Excel tip, please share it



Data Model and Relationships In Microsoft Excel Pivot Tables | MyExcelOnline


Bryan

Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).

He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.

See also  Sort an Excel Pivot Table Manually

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!

Share to...