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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
rodriguise
Regular Visitor

RFC3339 Dates

Dates in my source are stored in RFC3339 "2006-01-02T15:04:05.000Z07:00". The DateValue function does not like this, how can I make use of date function in the platform?

1 ACCEPTED SOLUTION

In Power Query, such dates can be converted to datetimezone format using formula

 

DateTimeZone.From(Text.Replace([Input],"Z","+"))

and changing the data type to date/time/timezone.

 

 

The data model doesn't have datetimezone format: when the result from Power Query is loaded into the data model, the UTC Offset is just cut off. If the data type is left as "any" in Power Query, the result loads as text.

Power Query has several functions to switch the UTC Offset and to convert datetimezone data to local date/time.

In the picture below you can see the input and 3 columns with the result from the formula above (my culture code is set to "en-US"): as datetimezone, as any, as datetime (which converts the datetimezone to the local UTC Offset; in my case, on January 2, 2006 +01:00, so 6 hours behind UTC Offset +07:00 and 8 hours ahead of UTC Offset -07:00).

 

DTZ in PQ and Data Model.png

Specializing in Power Query Formula Language (M)

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You could create a new column and make use of String manipulation formula's to extract out the portion you care about.

For example a LEFT(<Fieldname>, 10) would get the date portion.

(Right and MID should handle anything else you need)

In Power Query, such dates can be converted to datetimezone format using formula

 

DateTimeZone.From(Text.Replace([Input],"Z","+"))

and changing the data type to date/time/timezone.

 

 

The data model doesn't have datetimezone format: when the result from Power Query is loaded into the data model, the UTC Offset is just cut off. If the data type is left as "any" in Power Query, the result loads as text.

Power Query has several functions to switch the UTC Offset and to convert datetimezone data to local date/time.

In the picture below you can see the input and 3 columns with the result from the formula above (my culture code is set to "en-US"): as datetimezone, as any, as datetime (which converts the datetimezone to the local UTC Offset; in my case, on January 2, 2006 +01:00, so 6 hours behind UTC Offset +07:00 and 8 hours ahead of UTC Offset -07:00).

 

DTZ in PQ and Data Model.png

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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