Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Distinct on recurring value (column), while concatenating its unique value (column)

Good day all,

 

I want to trim a dataset be removing repeats of a certain column, like a distinct function. However, in another column there are unique values, which I would all like to keep, by concatenation. 

 

Example:

A dataset that looks like this:

OwnerCityPetName
BobBerlinDogChippy
BobBerlinCatZiggy
BobBerlinDogJiffy
JudyNew YorkCatTaco
JudyNew YorkCatBaco

 

Would become the following:

OwnerCityPetName
BobBerlinDog; Cat; DogChippy; Ziggy; Jiffy
JudyNew YorkCat; CatTaco; Baco

 

Does anyone know how I would go about this? I can imagine a concatenation before using distinct would be a valid approach. However, I do now know how to do this. Help is much appreciated!

  • you can try this

     

    pet2 = CONCATENATEX(DISTINCT('Table'[Pet]),'Table'[Pet],";")
    name2 = CONCATENATEX(DISTINCT('Table'[Name]),'Table'[Name],";")
     
     

3 Replies

  • you can try this

     

    pet2 = CONCATENATEX(DISTINCT('Table'[Pet]),'Table'[Pet],";")
    name2 = CONCATENATEX(DISTINCT('Table'[Name]),'Table'[Name],";")