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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Delete Words from Row

Hello All,

 

I am not sure if this is possible. I have rows of data with user names seperated by commas. Each row has two of the same user names "user1" and "user2" with a 3rd name that is typically different. The order of these users is different for each row. 

 

Is it possible to do below and exclude names based on text since the position is not cosistent?

 

Current

User Column

user1, user2, user3

user2, user5, user1

user7, user1, user2

 

Output

User Column

user3

user5

user7

 

I appreciate any help on this issue!

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

In PQ you can use this code

 

#"Changed Type" = Table.TransformColumnTypes(Facts44_Table,{{"User", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","user1","",Replacer.ReplaceText,{"User"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","user2","",Replacer.ReplaceText,{"User"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",",","",Replacer.ReplaceText,{"User"}),
#"Trimmed Text" = Table.TransformColumns(#"Replaced Value2",{{"User", Text.Trim, type text}})
in
#"Trimmed Text"

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
mangaus1111
Solution Sage
Solution Sage

In PQ you can use this code

 

#"Changed Type" = Table.TransformColumnTypes(Facts44_Table,{{"User", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","user1","",Replacer.ReplaceText,{"User"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","user2","",Replacer.ReplaceText,{"User"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",",","",Replacer.ReplaceText,{"User"}),
#"Trimmed Text" = Table.TransformColumns(#"Replaced Value2",{{"User", Text.Trim, type text}})
in
#"Trimmed Text"

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @mangaus1111 ,

 

Thank you! I was able to do this - only alteration was adding a space before and after the comma.

mangaus1111
Solution Sage
Solution Sage

Hi @datadmin-austin ,

 

in power query or DAX?

Hello @mangaus1111 ,

Either one works for me. This data comes from a SharePoint so many power query is better but I am open to suggestion.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.