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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
EugeneB
New Member

Column

I have a few similar and unique values in the same column, and I need only distinctive values, example: US,CA,ATL,ATL,US,FR->US,CA,ATL,FR

2 REPLIES 2
tamerj1
Super User
Super User

Hi @EugeneB 
1.png

Column Distinct = 
VAR String = 'Table'[Column]
VAR Items = SUBSTITUTE ( String, ",", "|" )
VAR Length = COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T1 = GENERATESERIES ( 1, Length, 1 )
VAR T2 = SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items, [Value] ) )
VAR T3 = DISTINCT ( T2 )
RETURN
    CONCATENATEX ( T3, [@Item], "," )

Thank you it works

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors