Forum Discussion
Remove trailing commas
ExcelKnut Add a new custom column with the following formula:
= Text.Replace(Text.TrimEnd([YourColumnName], ","), ",,", ",")
- ExcelKnut1 year agoFrequent Visitor
Thanks for your quick response. Unfortunately, that didn't seem to solve the issue.
Formula used: Text.Replace(Text.TrimEnd([Race], ","), ",,", ",")
Example #1: Native American,
Example #2: Asian, Black,
- bhanu_gautam1 year ago
Super User
Use this m
= if Text.EndsWith([YourColumnName], ",") then
Text.Start([YourColumnName], Text.Length([YourColumnName]) - 1)
else
[YourColumnName]- ExcelKnut1 year agoFrequent Visitor
Great formula but for some strange reason it's not removing the trailing comma.
I copied the table into Excel and it shows the last character is a comma.
However, in Power Query, I added a column to just get the last character in that column, the commas do not appear. Then, when I get the last two characters, the commas appear.
- nathancwatkins1 year ago
Helper II
Use Split by Delimiters, and start from the end.
--Nate