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
adriantiong84
New Member

the name 'id' is already used a column on a table

Capture.PNG

 

6 REPLIES 6
cphite
Helper I
Helper I

I am having a similar problem...  I have a power bi report that was originally pulling from an Oracle instance, and I have converted the scripts within to point at and pull from our local SQL Server instance.  Same schemas and so forth.

 

When I try to apply the changes in Power Query a long list of queries say that the name 'ID' is already used in another query; I've checked and while I do see it used in that query, I am not seeing it anywhere in the others - the ones that are throwing the error.  

 

So my assumption is that it's due to the joins in Power BI.  So I closed Power Query without applying and tried to rename the column... the problem is, Power BI won't let me rename (or remove) them unless I apply changes first - but I can't apply changes because of the duplicate column names.  So I am basically stuck - I can't do either without doing the other first.

 

If anyone knows a workaround I'd appreciate it!  

ankitpatira
Community Champion
Community Champion

@adriantiong84 As error suggests you can't have same column name for two columns in a table. Can you tell what you're trying to do ?

I have 4 tables with a CustomerID column. I get the error above for all four tables. No table have more than one column with name CustomerID. Worked fine until I tried to refresh the query.

What he means is that you can't have more than one copy of the same named field in the result set.

 

You can have them in the underlying tables as you likely need it to create the table relationships. So either rename the duplicate column or remove it from the result set.

 

 

Treb Gatte | Business Solutions MVP/ Power BI Showcase Partner | Power BI Recordings | @tgatte | Blog 

Anonymous
Not applicable

Can someone clarify please. Surely it is highly likely that multiple tables will have one column named 'ID'. I have done no transformation on the dataset I'm using and I'm getting twenty or so error because they each have a column called ID.

 

What steps should I take to avoid this problem? 

 

Anonymous
Not applicable

I had the same problem, and I wasn't getting any errors in Power Query because I didn't have any two columns with the same name in the same table. It was only when applying the changes that the problem arised. What I found in this case was that I had a calculated column with the same name in one of my tables and that was what was causing the error.

 

So my conclusion to this issue is:

1- First check in Power Query whether you have errors due to having two columns with the same name in the same table.

2- If your error only arises when you apply the changes from Power Query, check whether you have a measure or calculated column with the same name inn the same table in the resulting Power BI data model.

 

Hope this helps!

 

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.