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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Getting "not allowed for columns on the one side of a many-to-one relationship" errors

I have a PBIX file with various tables and relationships, among them initially everything was working fine, but whenever I add some data in the .xlsx file I am getting this error.
"Column 'metric' in Table 'CYTD-percentage' contains a duplicate value 'Application Availability - Platinum' and this is not allowed forcolumns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table."

 

I have another table 'Availability' with exactly the same function and relationship as 'CYTD-Percentage', everything works seamlessly for table 'Availability' but not for the 'CYTD-percentage'.

Any idea what the issue is here?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@jdbuchanan71 ,
Figured out a solution, the 'Availability' table already has repeated data in the metric columns. Power BI is not treating it as a column with only unique values and allows it to form the relationship between different tables, whereas the table 'CYTD-Percentage' metric column has only unique values, as a result, Power BI expects only unique values in the metric column. And when I add new data in the column it throws error "not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table".


So I deleted the 'CYTD-Percentage' table from Power BI and added dupliacte data in metric column in input file, then imported it in Power BI, formed all necessary relations, and it worked.
Please, let me know your thoughts.

View solution in original post

5 REPLIES 5
jdbuchanan71
Super User
Super User

@Anonymous 

In your excel file, select the whole data range except the headers and go to Data > Remove Duplicates.

Leave only the 'metric' column checked and hit OK.

jdbuchanan71_0-1613574953414.png

If you see a notice like this you know you have a duplicate in that column.

jdbuchanan71_1-1613574992561.png

You can undo the Remove Duplicates step then put use a COUNTIF against the metric column to find the dupe.

 

Anonymous
Not applicable

Hi @jdbuchanan71 ,
The data will have duplicate values. As the data in metric will increase with the increase in date, so I need those values.

R_S-13697_0-1613577833881.png

The above pic is of the table 'CYTD-percentage'.
And the following is for the table 'Availability'

R_S-13697_1-1613577970591.png

The main concern is why I'm getting the error in one case and none in another and how to remove those errors.

It sounds like you need a Metrics table that will have each metric once and you can link it into your data tables.   You can create something like that using this dax.

 

Metrics = 
DISTINCT(
    UNION(
        DISTINCT(CYTD-percentage[Metric]),
        DISTINCT(Availability[Availability])
    )
)

 

Anonymous
Not applicable

@jdbuchanan71 ,
Figured out a solution, the 'Availability' table already has repeated data in the metric columns. Power BI is not treating it as a column with only unique values and allows it to form the relationship between different tables, whereas the table 'CYTD-Percentage' metric column has only unique values, as a result, Power BI expects only unique values in the metric column. And when I add new data in the column it throws error "not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table".


So I deleted the 'CYTD-Percentage' table from Power BI and added dupliacte data in metric column in input file, then imported it in Power BI, formed all necessary relations, and it worked.
Please, let me know your thoughts.

amitchandak
Super User
Super User

@Anonymous , I doubt either one side of the table is getting a duplicate value or a blank value on the join column.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors