- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Remove first 2 characters from a column value
Hi.
I need to combine a few things, in PQE, in one new column.
I can do this via CONCATENATE.
Part of this combination is a value in a column, but I need to remove the first 2 characters.
Any idea how to do this?
Old | New |
2018 | 18 |
2021 | 21 |
Something | mething |
Once I have this formula, I can combvine it with my concatenate.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

From PQE, you can perform the below for having last 2 digits of Number column:
1. Duplicate the Number column
2. Perform below operations from Home ->Transform section at top:
Split Column >> By Number of Characters
3. Modify with below:
Number of Characters = 2
Split = Once, as far right as possible
4. Remove unwanted split column and rename new column
Alternatively, you can use below formula in Advanced Editor:
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Number", "Duplicated Number"),
#"Split Column by Position" = Table.SplitColumn(Table.TransformColumnTypes(#"Duplicated Column", {{"Duplicated Number", type text}}, "en-IN"), "Duplicated Number", Splitter.SplitTextByPositions({0, 2}, true), {"Duplicated Number", "New Number"}),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Position",{"Duplicated Number"})
Don't forget to give thumbs up and accept this as a solution if it helped you !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Namoh
Add this as a new custom column in Power Query.
Text.RemoveRange(Text.From([Old]),0,2)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Nope, this didn't work, probably because it's not text but a number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Try with MID:
= MID(Table[Old], 3,LEN(Table[Old]))
Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Excellent function. It's works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

you could also use the MID function
MID('Table'[Old],3,50)
https://docs.microsoft.com/en-us/dax/mid-function-dax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Excellent function. It's works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I get the message RIGHT is not recognised
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

No MID is also not recognised.
Are RIGHT and MID DAX functions?
As stated I'm in PQE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

In PQE(Power Query Editor), follow below steps:
1. Right click 'Old' columnname
2. Click on 'Split Column'
3. Click on 'By Positions...' (3rd option)
4. Type 2 in positions text field
5. Click OK
6. Rename the column to "New"
If you want to keep both 'Old' as well as 'New' columns, make sure you duplicate the column first and then perform above steps on duplicated column.
Don't forget to give thumbs up and accept this as a solution if it helped you !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I might add that my first post was not completely correct.
My data doesn't contain text, only numbers.
So I need to find a PQE function with which I can show the last 2 digits of a number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

From PQE, you can perform the below for having last 2 digits of Number column:
1. Duplicate the Number column
2. Perform below operations from Home ->Transform section at top:
Split Column >> By Number of Characters
3. Modify with below:
Number of Characters = 2
Split = Once, as far right as possible
4. Remove unwanted split column and rename new column
Alternatively, you can use below formula in Advanced Editor:
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Number", "Duplicated Number"),
#"Split Column by Position" = Table.SplitColumn(Table.TransformColumnTypes(#"Duplicated Column", {{"Duplicated Number", type text}}, "en-IN"), "Duplicated Number", Splitter.SplitTextByPositions({0, 2}, true), {"Duplicated Number", "New Number"}),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Position",{"Duplicated Number"})
Don't forget to give thumbs up and accept this as a solution if it helped you !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

This worked, thanks.
But isn't there a simple statement that can do this with numbers, just like the statements that are there for text?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I know this is an old post but a mathematical solution to getting the last two digits might be to rounddown and subtract from the original value:
'Table'[Old]-Number.RoundDown('Table'[Old],-2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Namoh to be fair, you did give us an alphanumeric example. Try the following.
= Text.Range(Number.ToText([Old]),2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Try the following
= Text.Range([old],2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Nope, this didn't work, probably because it's not text but a number.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
03-18-2024 10:25 AM | |||
08-21-2024 07:36 AM | |||
08-02-2024 11:49 AM | |||
Anonymous
| 10-19-2023 02:31 PM | ||
04-05-2024 09:09 PM |
User | Count |
---|---|
87 | |
81 | |
53 | |
38 | |
35 |