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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Date format error

Hi, 

 

Probably a stupid question but here it goes. 

 

From a SQL database I am trying to get some dates imported into Power BI Desktop, the date format is yyyymmdd, when I am trying to transform that into a recognized date format I get an error on all the dates. I am sure there is a simple solution for this but I am currently not able to find it. 

 

I cannot change the date format on the sql server.

 

Thanks in advance.

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

You cam convert to text first and to date next (in a separate step).

 

Example:

 

let
    Source = 20170312,
    #"Converted to Table" = #table(1, {{Source}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Column1", type date}})
in
    #"Changed Type1"
Specializing in Power Query Formula Language (M)

View solution in original post

1 REPLY 1
MarcelBeug
Community Champion
Community Champion

You cam convert to text first and to date next (in a separate step).

 

Example:

 

let
    Source = 20170312,
    #"Converted to Table" = #table(1, {{Source}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Column1", type date}})
in
    #"Changed Type1"
Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.