Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

To remove duplicate char from string on each row using DAX expression

Hi All,

Need your help to remove duplicate chars from string using DAX expression.

I have used the CONCATENATEX function to concatenate rows values based on some criteria. Due to this my string in single cell becomes as per below: 

 

 

 

 

 

Output String using CONCATENATEX function:

123333333333333333455555555555555567

Expected result:

1234567

 

I want to remove duplicate char from my string on each row.  Ihave tried insert values function inside CONCATENATEX  like : CONCATENATEX(table,values(filter(..)),filter(..)) .   But no success.

 

Thanks,

Gop01

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please update the formula of calculated column [sousOF_] as below and check if that is what you want. You can find the details in the attachment.

    sousOF_ = 
    CONCATENATEX (
        FILTER (
            VALUES ( Ds[ID] ),
            PATHCONTAINS ( [Lien], EARLIER ( [ID] ) )
                && VALUE ( [ID] ) >= VALUE ( EARLIER ( Ds[ID] ) )
        ),
        [ID]
    )

    Best Regards

6 Replies