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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

SummarizeColumn - Column in table contains a duplicate and is not allowed ...

 

 

Hi

I'm creating a new table using SummarizeColumn. Here's teh code.

The code below, works fine and I get the table built properly:

 

SUMMARIZECOLUMNS(
'Transactions'[FullDocumentNumber],
'Transactions'[PersonID],
'Transactions'[PersonName],
Filter('Transactions','Transactions'[Quarter]<>"2021-Q1" && 'Transactions'[Quarter]<>"2021-Q2" && 'Transactions'[Adjustments]="SALES" && 'Transactions'[BONUS]="YES"),

"BookedValue ($)",SUM('Transactions'[BookedValue ($)]),
"SALES",KPIs[Total Sales],
"Total GL Amount", [TotalRevnueGLAmounts],
"Pay or Not", if(
[BookingValue]=0 && KPIs[Total Sales]=0,"NO BONUS","BONUS"),
"Bonus ($)",if([BookingValue]=0 && KPIs[Total Sales]=0,0,0.001*[TotalGLAmounts]))

 

When I add another column called 'Transactions'[Quarter], I get the error message in the screenshot at end of this post.

SUMMARIZECOLUMNS(
'Transactions'[FullDocumentNumber],
'Transactions'[PersonID],
'Transactions'[PersonName],
'Transactions'[Quarter],     // ===> THIS LINE CAUSES TROUBLES
Filter('Transactions','Transactions'[Quarter]<>"2021-Q1" && 'Transactions'[Quarter]<>"2021-Q2" && 'Transactions'[Adjustments]="SALES" && 'Transactions'[BONUS]="YES"),

"BookedValue ($)",SUM('Transactions'[BookedValue ($)]),
"SALES",KPIs[Total Sales],
"Total GL Amount", [TotalRevnueGLAmounts],
"Pay or Not", if(
[BookingValue]=0 && KPIs[Total Sales]=0,"NO BONUS","BONUS"),
"Bonus ($)",if([BookingValue]=0 && KPIs[Total Sales]=0,0,0.001*[TotalGLAmounts]))

 

 

How can I overcome this issue?

 

YJAMOUS_1-1645124374741.png

 

1 ACCEPTED SOLUTION
bcdobbs
Super User
Super User

What relationships do you have to your calculated table? (Power Bi may have added them automatically). Remove any that are there, try your code again and then replace the relationships that you need. When you put the quarters in I suspect yoi start to get duplicates of maybe PersonId which is fine. However powerbi has already set a relationship based on a previous cardinality.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@bcdobbs Sorryyyyyyyyy Yes IT WORKED!

Thanks a lot

Anonymous
Not applicable

@bcdobbs thanks for your prompt response.

There are no relations and still same error message.

The id number that is mentioned in the error message what column does it belong to?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
bcdobbs
Super User
Super User

What relationships do you have to your calculated table? (Power Bi may have added them automatically). Remove any that are there, try your code again and then replace the relationships that you need. When you put the quarters in I suspect yoi start to get duplicates of maybe PersonId which is fine. However powerbi has already set a relationship based on a previous cardinality.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.