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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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