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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JK-1
Helper I
Helper I

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
Solution Sage
Solution Sage

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
Resolver IV
Resolver IV

I do not get the question

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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