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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JK-1
Helper II
Helper II

DAX to de-duplicate text string?

Would it be possible to get DAX de-duplicating a text string? In the example below - or any suggestions on alternate ways, but still using DAX  🙂  thanks in advance

 

AddressAreaDistributionstring = CONCATENATEX(FILTER(('Table'),'Table'[Address]=EARLIER('Table'[Address])),'Table'[Area],"; ")would then like it de-duplicated -- but wondered if DAX could facilitate?
George Street1st FloorZone 31st Floor; 1st Floor; 2nd Floor1st Floor; 2nd Floor
George Street2nd FloorZone 11st Floor; 1st Floor; 2nd Floor1st Floor; 2nd Floor
George Street1st FloorZone 51st Floor; 1st Floor; 2nd Floor1st Floor; 2nd Floor
Lime WalkBasementZone 7Basement; BasementBasement
Lime WalkBasementZone 4Basement; BasementBasement
Hope AvenueBasementZone 21st Floor; 1st Floor; BasementBasement; 1st Floor
Hope Avenue1st FloorZone 81st Floor; 1st Floor; BasementBasement; 1st Floor
Hope Avenue1st FloorZone 51st Floor; 1st Floor; BasementBasement; 1st Floor
Market Square2nd FloorZone 62nd Floor2nd Floor
1 ACCEPTED SOLUTION
Chanty4u
Regular Visitor

Try this.DeDuplicatedString =

CALCULATE(

    CONCATENATEX(

        VALUES('Table'[Area]), -- <-- this removes duplicates

        'Table'[Area],

        "; ",

        'Table'[Area]

    ),

    ALLEXCEPT('Table', 'Table'[Addr

ess])

)

View solution in original post

4 REPLIES 4
techies
Super User
Super User

Hi @JK-1 please try this calculated column

 

DeDuplicatedAreas =
VAR CurrentAddress = AddressAreas[Address]
VAR DistinctAreas =
    CALCULATETABLE(
        VALUES(AddressAreas[Area]),
        FILTER(
            ALL(AddressAreas),
            AddressAreas[Address] = CurrentAddress
        )
    )
RETURN
    CONCATENATEX(
        DistinctAreas,
        AddressAreas[Area],
        "; ",
        AddressAreas[Area], ASC
    )
 
techies_0-1752304056181.png

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
JJ_3
Frequent Visitor

Chanty4u is right. You can also only use

String =

CONCATENATEX(

VALUES('Table'[Area]), -- <-- this removes duplicates

'Table'[Area],

"; ",

'Table'[Area]


If u only us the adres
Chanty4u
Regular Visitor

Try this.DeDuplicatedString =

CALCULATE(

    CONCATENATEX(

        VALUES('Table'[Area]), -- <-- this removes duplicates

        'Table'[Area],

        "; ",

        'Table'[Area]

    ),

    ALLEXCEPT('Table', 'Table'[Addr

ess])

)

FBergamaschi
Solution Sage
Solution Sage

I do not get the question

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.