Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
FMPE
Frequent Visitor

Creating relationships between tables that contain duplicate values

Hi!

 

First of all, I'm fairly new to Power BI, so if I've got a concept completely wrong, or I'm approaching something in a silly way, please do let me know - I'm trying to learn!

 

So I've got 4 tables; the first two them are "raw" data I am sent once a month, and the last two are tables I've created for the report:

  • Table 1 - "Master": a list of incidents with that caused some machine to fail, including a number of details including the machine ID (a unique identifier), the Type (which type of machine it is) and the dates for both the occurence of the incident and when it was fixed.
  • Table 2 - "Machine data": a list comprised of information about a given machine and whether or not is it in use. This list is formatted in such a way so that every month, data for every active machine is appended, e.g. the name, the date of the month for which it has been active and a few other details.
  • Table 3 - "Active machine data":  basically a slice of table 1 including just the last month, to have a table that includes just the machines that are currently active. I created this table to have a table with unique IDs as to create a relationship with the Master table (Table 1) from which I can easilly do analysis.
  • Table 4 - "Calendar table": Fairly self-explanatory - a calendar table connected up with the Master table to perform slicing, etc.

 

What I'm trying to do, and have achieved successfully using a relationship between Table 1 & 3, is calculating and displaying the number of "off days" for each machine for each month. Doing the most recent month is easy, as I'm able to use table 3 which has unique machine IDs meaning that I can create a relationship bewteen it and the master table. However, now that I'm trying to do the same with the historic data, I run into trouble as the duplicated IDs in table 2 doesn't allow for me to create a relationship between it and the master table (which was the whole reason for creating table 2 in the first place).

 

So, basically my question is: how do I go about this the best way? Should I merge the tables somehow, alter either tables, create a many-to-many relationship, or something entirely different?

 

Again, apologies for the potentially stupid question and/or explaination. If I was unclear, please tell me what to clarify / expand upon and I'll try my best to do so.

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @FMPE ,

According to your description, it seems that you got some problem when created the relationships between tables. What's your final expected result? It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

 

In addition, you can refer the following links to create relationship:

Model relationships in Power BI Desktop - Power BI | Microsoft Learn

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

 

Creating Relationship Based on Multiple Fields in Power BI Using TREATAS DAX Function - RADACAD

 

Solved: Relationships between tables when both have duplic... - Microsoft Fabric Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @FMPE ,

According to your description, it seems that you got some problem when created the relationships between tables. What's your final expected result? It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

 

In addition, you can refer the following links to create relationship:

Model relationships in Power BI Desktop - Power BI | Microsoft Learn

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

 

Creating Relationship Based on Multiple Fields in Power BI Using TREATAS DAX Function - RADACAD

 

Solved: Relationships between tables when both have duplic... - Microsoft Fabric Community

Best Regards

Apologies for the late reply, I have been figuring things out and learning a lot since I made the post, and I somehow overlooked that there had been a reply here. Unfortunately, I am not able to share the .pbix, as the data isn't confidential.

I am going to mark your response as an answer, as my problem has developed into something else entirely, and I'll make a new post for adressing that, instead of editing this one.

Thanks!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.