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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Convert YYYYMMDDHHMMSS into DD.MM.YYYY

Hello there, 


a field called "lastseen" contains a String which represents a date in the format YYYYMMDDHHMMSS. For example 20230516075823. 
How can I convert it to DD.MM.YYYY?

 

I treid the following code from Solved: Converting Text into Date - Microsoft Power BI Community 

 

 

 

Table.TransformColumns(#"_RSALL_FULL_PERNR-USERS",{{"lastseen", each if _ = "0" then null else Text.Insert(_,8,"T"), type text}})

 

 

 

But I get the error:  Expression.Error: The name '_RSALL_FULL_PERNR-USERS' wasn't recognized. Make sure it's spelled correctly.

1 ACCEPTED SOLUTION
BiNavPete
Resolver III
Resolver III

Hi @Anonymous 

See attached PBIX here.

In Powerquery take the left 8 characters by adding a custom column using Text.Start
Table.AddColumn(Source, "Custom", each Text.Start([StringDate],8))

Then use Date.FromText on that column
Table.AddColumn(#"Added Custom", "Date", each Date.FromText([Custom]))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

Pete
Web: https://binavigation.com
Linked In: https://www.linkedin.com/in/pete-smith-955b73181

View solution in original post

4 REPLIES 4
BiNavPete
Resolver III
Resolver III

Hi @Anonymous 

See attached PBIX here.

In Powerquery take the left 8 characters by adding a custom column using Text.Start
Table.AddColumn(Source, "Custom", each Text.Start([StringDate],8))

Then use Date.FromText on that column
Table.AddColumn(#"Added Custom", "Date", each Date.FromText([Custom]))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

Pete
Web: https://binavigation.com
Linked In: https://www.linkedin.com/in/pete-smith-955b73181

Ritaf1983
Super User
Super User

HI @Anonymous 
Here is a video showing a method I used at my place that worked well.

https://www.youtube.com/watch?v=6kKT6QGikMM

If you are still having trouble, please share a sample table with your data.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Anonymous
Not applicable

In the Video he hast the Format YYYMMDD. In my case I habe the format YYYYMMDDHHMMSS, when I follow the Steps in the Video I get a Error. 

Hi @Anonymous 
As I mentioned in my previous response, I would be happy to assist,
Please share the data table in a format that I can work with.
Thanks, Rita.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors