Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX Replace repetitive string with one string

Hi Everyone,


I have a column with the click flow of a user on a specific day: 

ClickFlowColumn = CALCULATE(CONCATENATEX(ActivitiesTable, ActivitiesTable[ActivityType], ", "), ALLEXCEPT(ActivitiesTable, ActivitiesTable[UserId], ActivitiesTable[Date]))


BUT, When activities repeat themselves, it becomes impossible to visualise or group the data. I would like to replace repetitive strings (activities) with one single string:

 

What I haveWhat I want
ClickFlowColumnClickFlowColumn
click , click, preview, insert, insert, insertclick, preview, insert
click, search, search, search, previewclick, search, preview

 

Dax only please, because this is a calculated column.

 

Some help would be much appreciated!

  • Fowmy's avatar
    Fowmy
    6 years ago

    Anonymous 

    What do you change your formula like this?

    ClickFlowColumn =
    CALCULATE (
        CONCATENATEX (
            VALUES ( ActivitiesTable[Activity Type] ),
            ActivitiesTable[Activity Type],
            ", "
        ),
        ALLEXCEPT ( ActivitiesTable, ActivitiesTable[UserId], ActivitiesTable[Date] )
    )

     

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

6 Replies