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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Chrisjr
Helper IV
Helper IV

Remove first characters of a column with condition

Hello All, 

 

I have the following column:

 

Brand
Volvo
2023 07 Volvo
2023 10 VW
2022 12 Peugeot
BMW
2023 01 BMW
Peugeot
Audi

 

 

If the text of the column start with a date, I need to remove only the date, so in my case the first 9 characters (with the bkanks) and only keep the brand names.  (When the date appears at the start, the format is Year month)

 

So the end result would look as below :

 

Brand
Volvo
Volvo
VW
Peugeot
BMW
BMW
Peugeot
Audi

 

 

How could I achieve this in the Power Query ?

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Hello, @Chrisjr 

let
    Source = your_table,
    nums = List.Buffer({"0".."9", " "}),
    tx = Table.TransformColumns(Source, {"Brand", each Text.TrimStart(_, nums)})
in
    tx

View solution in original post

2 REPLIES 2
Chrisjr
Helper IV
Helper IV

thanks @AlienSx 

AlienSx
Super User
Super User

Hello, @Chrisjr 

let
    Source = your_table,
    nums = List.Buffer({"0".."9", " "}),
    tx = Table.TransformColumns(Source, {"Brand", each Text.TrimStart(_, nums)})
in
    tx

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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