Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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?
Solved! Go to 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).
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).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |