Forum Discussion
Remove first 2 characters
Hi,
I have a column that every value starts with a 4/
The length of each can vary e.g
4/TTP000
4/123
I therefore just need to remove the 4/. Any idea how to do this please?
Many thanks
Hi M_SBS_6 ,
You can try creating a new column in Power Query editor with the below formula -
= Table.AddColumn(#"Added Conditional Column", "New Column", each Text.AfterDelimiter([Original Column], "/"), type text)
In DAX -New Column = right([Original column], len([Original column]) - search("/",[Original column],,0))Hope this helps!Please accept the solution if this answers your query.Thanks!Avantika Thakur
3 Replies
- Avantika-ThakurSolution Supplier
Hi M_SBS_6 ,
You can try creating a new column in Power Query editor with the below formula -
= Table.AddColumn(#"Added Conditional Column", "New Column", each Text.AfterDelimiter([Original Column], "/"), type text)
In DAX -New Column = right([Original column], len([Original column]) - search("/",[Original column],,0))Hope this helps!Please accept the solution if this answers your query.Thanks!Avantika Thakur- M_SBS_6Helper V
Thank you
- serpiva64Solution Sage
Hi,
in dax you can create a calculated column this way
Column = var ColumnLength = LEN('Table'[Column1])-2var result = RIGHT('Table'[Column1], ColumnLength)returnresultand you obtainIf this post is useful to help you to solve your issue consider giving the post a thumbs up
and accepting it as a solution !