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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Reimer
Helper II
Helper II

Remove last 4 numbers of a row

I would like to remove the last 4 numbers of a column. Does anyone know how to do this?

1 ACCEPTED SOLUTION

@Reimer 

 

You may create a new column to remove the last 4 strings, remember change the new column from Text type to Wholenumber.

 

Column2 = LEFT('Table'[Column1],LEN([Column1])-4)

 

remove last 5 digits.JPG

 

BTW, if you create a column using M query from @Pragati11 reply, you need to change the original colum type to Text first, then create that custom column.

 

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

View solution in original post

8 REPLIES 8
Prinshika3
New Member

Select a blank cell, enter formula =RIGHT(A2,4) into the Formula Bar, and then press the Enter key for removing the last 4 digits of numbers or more!

amitchandak
Super User
Super User

@Reimer , you want to remove rows of only in the column. You have few options under data transformation

refer: https://docs.microsoft.com/en-us/power-bi/desktop-shape-and-combine-data

Pragati11
Super User
Super User

Hi @Reimer ,

 

Does this removing last 4 numbers from a row is conditional based or you just want to eliminate last 4 rows from your dataset?

 

You can use something as below using M query in Query Editor in Power BI to remove rows from data:

https://docs.microsoft.com/en-us/powerquery-m/table-removerows

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

I think this is just not quite it. Let me try to explain a bit better.

 

A column in Power BI is a value like "12345670000" But sometimes it is "123456780000" I just need to remove the 0000.

 

I tried using splitting the column. This nearly worked :-,), but the problem is that sometimes there are 7 number, sometimes 8

Hi @Reimer ,

 

You can try transforming your column in Query Editor. Check for the following option and remove last 4 characters from your column ("0000"):

extract1.png

 

Let me know if this is what you are looking for.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Almost! Useing this will delete anything after a specified amound of numbers, but I am looking for a way to just delete the last 4. because sometimes I need to keep 6 or 7 numbers

@Reimer 

 

You may create a new column to remove the last 4 strings, remember change the new column from Text type to Wholenumber.

 

Column2 = LEFT('Table'[Column1],LEN([Column1])-4)

 

remove last 5 digits.JPG

 

BTW, if you create a column using M query from @Pragati11 reply, you need to change the original colum type to Text first, then create that custom column.

 

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

Hi @Reimer ,

 

You can use a M query code to achive this:

Text.Start([column];Text.Length([column])-2)

Replace [column] with your column-name. This remove last 2 characters, so replace 2 with 4 in your case.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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