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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Remove the last "/" slash in same column

Hi,

 

Is there a way to trim the last "/" and keep the value in same column?

Here's what has been done.

h_l_0-1615564356558.png

 

Then, I add one more step and try to remove "/" in last characters, then I tried to change the code but then got error:

h_l_1-1615564614790.png

 

If I use the Addcolumn, the code is:

Table.AddColumn(#"Lowercased Text", "Trim", each Text.TrimEnd([Page],"/"))

But this does not work if I want to keep the value in same Column.

 

Could you please help.

Thanks!

H

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

 

1. On the Transform tab, select your column and choose Format - Trim.

V-pazhen-msft_0-1615946893264.png

 

2. Change the code:

Text.Trim to each Text.TrimEnd(_,"\")

V-pazhen-msft_1-1615946955757.png

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Anonymous 

 

1. On the Transform tab, select your column and choose Format - Trim.

V-pazhen-msft_0-1615946893264.png

 

2. Change the code:

Text.Trim to each Text.TrimEnd(_,"\")

V-pazhen-msft_1-1615946955757.png

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Thank you @Anonymous 👍

Anonymous
Not applicable

hello @Anonymous ,

Do like this:

 

let
Source = Excel.Workbook(File.Contents("C:\Users\kgawale\Desktop\powerBIcommunity.xlsx"), null, true),
Sheet2_Sheet = Source{[Item="Sheet2",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet2_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Order", Int64.Type}, {"Tasknumber", type text}, {"Department", type text}, {"Creation date", type any}, {"Data", type text}}),
#"Removed Bottom Rows" = Table.RemoveLastN(#"Changed Type",3),
#"Split Column by Delimiter" = Table.SplitColumn(#"Removed Bottom Rows", "Data", Splitter.SplitTextByEachDelimiter({"/"}, QuoteStyle.None, true), {"Data.1", "Data.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Data.1", type text}, {"Data.2", Int64.Type}})
in
#"Changed Type1"

 

 

Right click on the column, Split column option->By delimiter

select or Enter the delimiter->Keep custom and  \

Split at -> Right most delimiter

Quote character-> None

 

 

Krutigawale33_0-1615567645268.png

 

Anonymous
Not applicable

Maybe I didn't state clearly.

What expected is not split into 2 columns, but remain the value in same column just remove the last "/" if there is.

e.g.

before:

图片.png

 

After:

图片.png

 

Thanks for reply.

Anonymous
Not applicable

Hello @Anonymous ,

I am not sure if you would like to create new column or not.

But you can achieve similar result by creating new column in report.

Column = IF(RIGHT(TableName[URLs],1)="/",LEFT(TableName[URLs],LEN(TableName[URLs])-1),TableName[URLs])
Anonymous
Not applicable

@AnonymousAs in OP mentioned, ideally, it's better remain in same column, but not split to 2 columns or create a new column. But Thanks for your idea and replies, I will try on creating new column and to see if there is any further actions required on further progress.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors