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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
simormate
Frequent Visitor

Duplicate value error message in Power BI, when the same code works in DAX Studio

I use the following code for a calculated table in Power BI:

CALCULATETABLE(

Contracts,
PricePlans[Range] = TRUE(),
Partners[Parent Company Name] = BLANK()

)

The table cannot be created, and I receive the error message saying:

Column '' in Table '' contains a duplicate value '24909' and this is 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.

I guess there should be column and table names between the single quotes, but there is nothing. I also checked the two relationships, both are many-to-one. The value 24909 is twice on the many side, and once on the one side.

 

What's even weirder is that the same command runs flawlessly in DAX Studio and gives back the result I look for.

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
simormate
Frequent Visitor

Ok, I found a solution, I just needed to ask the question here 🙂

I deleted the table and recreated it again, and it worked. Maybe it had to do with a calculated column I added to this table. After adding the calculated column, I modified the model somewhat, which resulted in the error message.

 

Anyway, I would still love to hear some ideas about how could I have diagnosed the problem.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

I got the idea of deleting and recreating the table again. However, it is very strange. In my case I get the same message but I was creating a table with the DAX UNION function and according to the documentation although there are duplicates in the two sets with the same columns, it still failed me but it should work. I backed up the DAX code, deleted the table then recreated it with the same code and that's it.

simormate
Frequent Visitor

Ok, I found a solution, I just needed to ask the question here 🙂

I deleted the table and recreated it again, and it worked. Maybe it had to do with a calculated column I added to this table. After adding the calculated column, I modified the model somewhat, which resulted in the error message.

 

Anyway, I would still love to hear some ideas about how could I have diagnosed the problem.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors