How to Fix Excel Data Model Relationships Not Working in PivotTables
Question details
The user is experiencing incorrect or repeated values in a PivotTable when trying to relate two fact-like tables directly in the Excel Data Model.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Building a comprehensive PivotTable from multiple data sources or fact tables utilizing the Excel Data Model.
- Observed behavior
- The PivotTable displays repeated, duplicate, or incorrect values because the direct relationship between two fact tables lacks a proper filtering path.
Ensure that your source data ranges are formatted as Excel Tables and identify the common column (such as an ItemCode or ID) that links your different datasets.
Create a Shared Dimension Table (Star Schema)
Instead of linking two fact tables directly, use a third 'dimension' table containing unique values to act as a bridge, establishing the correct filtering path.
Relating two fact-like tables (tables with repeating keys) directly in the Data Model often leads to a many-to-many relationship issue, causing PivotTables to display duplicate or inaccurate totals. To solve this, you need a Star Schema design where a central dimension table filters the fact tables.
Copy the common linking column (e.g., ItemCode) from both of your existing tables and paste them into a single column on a new worksheet. Go to the Data tab and click 'Remove Duplicates' to create a list of strictly unique values.
Select your new list of unique values, press Ctrl+T to format it as a Table, and give the table a descriptive name like 'Dim_Item'.
Click anywhere inside your new dimension table, navigate to the Power Pivot tab, and select 'Add to Data Model'.
In the Power Pivot window, go to Diagram View. Drag the linking column from your first fact table to the unique linking column in your new dimension table. Repeat this process for the second fact table.
Insert a new PivotTable from the Data Model. When adding fields to the Rows or Columns areas, you must drag the linking field (e.g., ItemCode) from the new Dimension table, not from either of the fact tables.

Merge Tables Using Power Query
If you prefer a flattened data structure over managing Data Model relationships, use Power Query to merge the two tables into a single dataset before creating a PivotTable.
Handle Complex Data Analysis Easily with WPS Office
If troubleshooting advanced Data Model relationships in Microsoft Excel is slowing you down, WPS Office provides a highly intuitive and lightweight alternative. Enjoy seamless compatibility with Excel files and powerful built-in PivotTable and data consolidation features without the steep learning curve.
- 1. Download and Install: Visit the official WPS Office website to download the free installer. Run the setup file to install the suite on your computer.
- 2. Open Your Data File: Launch WPS Spreadsheet and open your existing .xlsx workbook. All your tables and raw data will display perfectly.
- 3. Analyze with PivotTables: Select your data range, go to the Insert tab, and click PivotTable to quickly summarize and analyze your records.

Frequently Asked Questions
Why do I get duplicate values when joining two tables in an Excel PivotTable?
This usually happens when you create a direct relationship between two 'fact' tables (tables containing transactional or repeated data). Without a dimension table containing unique bridging values, the Data Model cannot determine the correct filtering path, leading to Cartesian products or duplicate totals.
What is a dimension table in the Excel Data Model?
A dimension table is a lookup table that contains a single row for each unique item, such as a unique list of Product IDs or Customer Names. It is used to connect multiple fact tables in a 'star schema' design so that data can be filtered correctly across a multi-table PivotTable.
Can I relate tables in Excel without using the Data Model?
Yes. You can use functions like VLOOKUP, XLOOKUP, or INDEX/MATCH to pull data from one table into another, effectively flattening your data into a single table. Alternatively, you can use Power Query to merge the tables before generating a standard PivotTable.




