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

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