many to many relationship problem
Our take
The Struggle Behind the Spreadsheet: Why Many-to-Many Relationships Challenge Even Savvy Excel Users
The Reddit post from user Purple-Orange captures a frustration that millions of spreadsheet users encounter when they outgrow simple table structures. This beginner Excel user did something remarkable: they independently designed a proper relational database schema with separate tables for Products, Tags, and Product_tags, then connected everything through Excel's Data Model. Yet when they tried to analyze sales by tag, the pivot table returned meaningless results showing every product under every tag. The irony is striking, and the lesson is valuable: building the right structure is only half the battle.
What Purple-Orange discovered is that Excel's Power Pivot has fundamental limitations when traversing multiple relationship hops in a single query. Their data model is structurally sound, but the pivot table cannot automatically filter sales by tag because there is no direct path from Tags to Sales that the engine can follow in a single context. The data exists, the relationships are technically correct, but the visualization layer cannot connect the dots without additional configuration. This is not a flaw in the user's approach; it is a limitation that trips up even experienced analysts who are new to Power Pivot's particular quirks.
The real issue stems from how Excel handles many-to-many relationships in pivot tables. When a product can have multiple tags and a tag can apply to multiple products, traditional filtering breaks down because the engine needs explicit instructions about which path to follow. The solution typically involves either creating a dedicated bridge table that consolidates the relationships or writing a DAX measure that explicitly calculates the connection between Sales and Tags through the Product_tags junction table. Without this additional layer, the pivot table defaults to showing all possible combinations, which appears as the "every product under every tag" problem the user described.
This scenario highlights a broader truth about modern spreadsheet work: the gap between data structure and data analysis is wider than most users realize. Tools like Excel's Data Model, Power Query, and DAX represent a different paradigm from traditional spreadsheet formulas, one that borrows heavily from database design but does not always translate those concepts intuitively. Users who take the initiative to learn these tools, as Purple-Orange did, are precisely the ones who will unlock transformative capabilities, but they often hit walls that feel arbitrary and frustrating.
For readers facing similar challenges, the path forward involves understanding that proper data modeling in Excel requires explicit configuration beyond simply establishing relationships. The investment in learning these nuances pays dividends, however, because the same principles apply across Power BI, SQL, and other data tools. As spreadsheet applications continue evolving toward more sophisticated data handling, the users who master these relationship concepts today will find themselves ahead of a curve that is only going to become more important. The question worth watching is whether Microsoft will simplify these multi-hop relationship scenarios in future updates, or if the responsibility will remain on users to build the bridge between their data and the insights they need.
Hello all, beginner at excel and first time posting here. After a lot of pain.
I have a sales table with data from the past few years, and wanted to be able to analyze sales across different categories- specifically 'product type' (an arbitrary category for analysis) and 'scent'.
Now the thing is, some products might fit into more than one product category, so simply adding a column wasnt going to cut it.
After discussing this with my excel advisors (chatgpt and claude..) I ended up doing the following:
A table called "Products" with 1 column: Product ID (unique)
A table called "Tags" with 1 column: Tags (unique)- this includes both the product types as well as scents.
A table called Product_tags - 2 columns: ID, and tag. Theyre both not unique (since a each ID likely has at least 2 tags, for type and scent, and sometimes 3).
Finally, the Sales table, which has a bunch of sales data, as well as a column for ID, and these are also repeating as well.
I created a data model (for the first time i think) and added all the tables. I then created the following relationships:
Sales <- Products (By ID) - many to one relationship
Product_tags <- Products (by ID) - many to one relationship
Product_tags <- Tags (by Tag) - many to one relationship
Now my problem:
When I create a pivot table (from data model) I can group or filter the revenue by product ID (the one from the products table) and it works. However, the tags dont work.
Whichever tag I choose (from the 2 tag tables) doesnt work for grouping or for filtering when I use it with any item from another table. for example, if I put "ID" from the product_tags table with "tag" from the same table, both as rows, I get to see each product, and which tags it has. or each tag and all the product IDs relevant to it.
However, if I put tags with "ID" the sales table or from the products table, the grouping doesnt work. Each tag has all products show up and vice versa. Basically, the tags dont work with the other data in my data model...
I cant seem to make this work, i've been at this for hours. This analysis is rather important for me to get done by today yet the day is basically over, and I havent been able to do anything.
Help me out.
Thanks.
[link] [comments]
Read on the original site
Open the publisher's page for the full experience