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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Issue with relationship for Group by and tables

Hi Team,

 

I need some guaidance on how to best approach this. We have three tables. 

Table 1:  all the data of different devices group by month. Same devices different results for each month. 

YearMonthvaluedeviceSite
2019111_greenWRXAAL
2019110_redWRX2AAL
2019120_redWRXAAL
     

Table 2: taking a source of device table, grouping the data by month for sites. Each site can have mulitple devices. value is green because we are taking max number of that of devices.

YearMonthSitevalue
201911AAL1_green
201912AAL0_red

 

Table 3: It is another table which all the devices listed by site.. Intent is for this table to get unique value of device.

 

Table 1 and 2  expected to have duplicate values because data is being group by month of the same site and devices

 

I need help creating realtionship between Table 2 and 3. Currently, I have many to one relationship from Table 3 to Table 2. But I got error Table 2 contains duplicate value and is not allowed on one side of many to one relationship or columns that are used as primary key of a table. I'm using site as key to connect them.

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

For the error message above, there may be  duplicate values in the Table2, so it is unavailable to keep Table 2 on one side of many to one relationship. You might use Many to Many relationship or change the table direction of many to one relationship for Table 2.

 

 

Best Regards,

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

For the error message above, there may be  duplicate values in the Table2, so it is unavailable to keep Table 2 on one side of many to one relationship. You might use Many to Many relationship or change the table direction of many to one relationship for Table 2.

 

 

Best Regards,

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Does anybody have any guidance on this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.