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

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
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.