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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

How to remove duplicates from calculated column

I have a calculated column which was created using RELATEDTABLE

NAMES=
CALCULATE(CONCATENATEX(RELATEDTABLE('TABLE'),
[NAME],
    ","
))
What I currently have
IDNAMES(CALCULATED COLUMN)
1A,A,B,C,D,D
2A,B,E,E,D,F,F
3A,A,S,S,D,F,H
4A,S,D
5A,A

 

What I need:

1A,B,C,D
2A,B,E,D,F
3A,S,D,F,H
4A,S,D
5A

 

Can you please let me know how to get distinct values for a calculated column.

 

Thank you!

 

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Try something like:

Unique IDs = CONCATENATEX(
    DISTINCT(SELECTCOLUMNS(RELATEDTABLE('Table'), "values", 'Table'[Value])), 
    [values], 
    ", "
)

 

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Try something like:

Unique IDs = CONCATENATEX(
    DISTINCT(SELECTCOLUMNS(RELATEDTABLE('Table'), "values", 'Table'[Value])), 
    [values], 
    ", "
)

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.