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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Rifdhy
New Member

Remove Unwanted text from Date Columns

Hi There,
Please note that I need to remove following unwated Strings from here and changed into Date Format.

 

Rifdhy_0-1665768074651.png

In here I need to change values as >

Rifdhy_1-1665768194261.png

1. First column Directly changed to Date Format
2. Second Row shows as BLANK
3. in third row that String get deleted and Changed to Date Format

Please help me to do above task guys

Thanks in Advance,
Faithfully
Rifdhy
@TexttoDate@RemoveStringsfromDateColumns



1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

If the date in the string is separated from other elements by a space, try adapting this example to your data:

let

//sample table
    Source = Table.FromColumns({
        {"01/04/2022",
          "N/A",
          "PROCESSED DATE: 03/11/2022"}},
          type table[processed_date=any]),

    #"Dates Only" = Table.TransformColumns(Source,{"processed_date", (e)=> 
        List.Sort(
            List.Transform(
                Text.Split(e," "), 
                    each try Date.From(_, "en-US") otherwise "")){0}, type date})
in
    #"Dates Only"

 Source

ronrsnfld_0-1665839414137.png

 

Result

ronrsnfld_1-1665839445756.png

 

 

 

View solution in original post

4 REPLIES 4
ronrsnfld
Super User
Super User

If the date in the string is separated from other elements by a space, try adapting this example to your data:

let

//sample table
    Source = Table.FromColumns({
        {"01/04/2022",
          "N/A",
          "PROCESSED DATE: 03/11/2022"}},
          type table[processed_date=any]),

    #"Dates Only" = Table.TransformColumns(Source,{"processed_date", (e)=> 
        List.Sort(
            List.Transform(
                Text.Split(e," "), 
                    each try Date.From(_, "en-US") otherwise "")){0}, type date})
in
    #"Dates Only"

 Source

ronrsnfld_0-1665839414137.png

 

Result

ronrsnfld_1-1665839445756.png

 

 

 

Anonymous
Not applicable

Hi ronrsnfld 

 

I have the same issue but with multiple coloumn, is there a form of loop that can be use to sort it.

Use List.Transform to convert a list of the relevant columns into a transformation_operations List. And use that in the Table.TransformColumns step in place of what is there.

 

Something like:

 

List.Transform(List_Of_Date_Columns_To_Process, (cn)=> {cn, (e)=> 
        List.Sort(
            List.Transform(
                Text.Split(e," "), 
                    each try Date.From(_, "en-US") otherwise "")){0}, type date}))

 

 

serpiva64
Solution Sage
Solution Sage

Hi,

you can extract last 10 characters

serpiva64_0-1665770809899.png

then change type to date

and finally replace  errors with null

serpiva64_1-1665770891316.pngserpiva64_2-1665770923325.png

null is blank in visualization

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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