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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

remove comma at the end of a string

Hi,

 

A bit new to power query and I cant seem to find a soultion for puting a pipiline between words and removing the comma at the end of a string ex. AAA, BBB, needs to transform to AAA | BBB

 

Any help or guidance appreciated.

 

Thanks.

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

You can use this where Data is column name

 

= Text.Replace(Text.TrimEnd([Data],","),","," |")
\\ A more robust formula would be
Text.Replace(Text.Replace(Text.TrimEnd([Data],",")," ",""),","," | ")

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Vijay_A_Verma thanks.

 

Is the approache the same for a column that is AAA, BBB, CCC, ? I cant seem to get it working.

 

Br.

Rado

Vijay_A_Verma
Super User
Super User

You can use this where Data is column name

 

= Text.Replace(Text.TrimEnd([Data],","),","," |")
\\ A more robust formula would be
Text.Replace(Text.Replace(Text.TrimEnd([Data],",")," ",""),","," | ")

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.