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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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!

1 ACCEPTED SOLUTION

@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] )
)

Fowmy_0-1598529538176.png

 

________________________

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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
vanessafvg
Super User
Super User

have you tried use the contcatenex function?
CONCATENATEX(VALUES(Table1[Column1]),[Column1])




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Hi @vanessafvg 

 

That worked!

@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] )
)

Fowmy_0-1598529538176.png

 

________________________

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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  That worked! Thank you! 

amitchandak
Super User
Super User

@Anonymous , three functions in power query should to it

 

Text.Split
https://docs.microsoft.com/en-us/powerquery-m/text-split

List.Distinct
https://docs.microsoft.com/en-us/powerquery-m/list-distinct

Text.Combine
https://docs.microsoft.com/en-us/powerquery-m/text-combine

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak thank you, but I'm working with calculated columns, so unfortunately Power Query won't solve my problem.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.