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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Convert STRING to DATE format

Hi all ,

I have a column with STRING format values which needs to be changed into DATE format.

Eg: I want to convert string "200502" into DATE format as 2020,May,2nd.

Thanks in advance.
Regards.

1 ACCEPTED SOLUTION

What do you get if you use DATE function?

Using "200502" it would look like

DateColumn = 
DATE("20" & LEFT('Table'[Date],2),
            MID('Table'[Date],3,2),
            RIGHT('Table'[Date],2)
    )

 

View solution in original post

4 REPLIES 4
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

You could create a calculated column to extract the parts and then change it into a date.

Example:

 

DateColumn = 
"20" & LEFT('Table'[Date],2) & "," & 
       MID('Table'[Date],3,2) & "," & 
       RIGHT('Table'[Date],2)

 

Anonymous
Not applicable

@Gordonlilj Thanks!
Tried that, it is throwing an error that Text cannot be converted into Date format.
Any other workaround? 

What do you get if you use DATE function?

Using "200502" it would look like

DateColumn = 
DATE("20" & LEFT('Table'[Date],2),
            MID('Table'[Date],3,2),
            RIGHT('Table'[Date],2)
    )

 

Anonymous
Not applicable

@Gordonlilj Thanks! This worked 😄

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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