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! Learn more

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Kudoed Authors