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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Community Champion
Community Champion

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
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.