Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I've tried way too many combinations of formulas for text data that is formatted like this: 01/01/2024 1:23 AM PST. There is nothing that I've found that will provide the correct results. It even stumped Claude.ai! If there is anyone here that knows how it is possible to convert this seemingly basic format to useable data I would greatly appreciate it! Here is a sample of my table:
User Name | Email ID | Login/Access Time | Logout/Left Time | |
A0 | email00 | 01/01/2024 1:23 AM PST | 01/26/2024 2:44 PM PST | |
A1 | email01 | 01/01/2024 1:23 AM PST | 01/26/2024 2:44 PM PST | |
A2 | email02 | 01/01/2024 5:21 AM PST | 02/29/2024 10:03 PM PST | |
A3 | email03 | 01/01/2024 7:50 AM PST | 02/15/2024 10:03 PM PST | |
A4 | email04 | 01/01/2024 7:55 AM PST | Still Logged In | |
A5 | email05 | 01/01/2024 8:08 AM PST | 02/15/2024 10:03 PM PST | |
A6 | email06 | 01/01/2024 8:23 AM PST | Still Logged In | |
A7 | email07 | 01/01/2024 8:36 AM PST | 02/15/2024 10:03 PM PST | |
A8 | email08 | 01/01/2024 8:51 AM PST | 02/15/2024 10:03 PM PST | |
A9 | email09 | 01/01/2024 9:32 AM PST | 01/04/2024 4:58 PM PST | |
A10 | email10 | 01/01/2024 9:34 AM PST | 01/03/2024 3:29 PM PST | |
A11 | email11 | 01/01/2024 9:50 AM PST | 01/03/2024 3:29 PM PST | |
A12 | email12 | 01/01/2024 10:00 AM PST | 01/18/2024 9:56 AM PST | |
A13 | email13 | 01/01/2024 10:03 AM PST | 01/03/2024 3:29 PM PST | |
A14 | email14 | 01/01/2024 10:05 AM PST | 02/15/2024 10:03 PM PST | |
A15 | email15 | 01/01/2024 10:07 AM PST | 01/03/2024 3:29 PM PST | |
A16 | email16 | 01/01/2024 10:27 AM PST | 01/07/2024 2:57 PM PST | |
A17 | email17 | 01/01/2024 10:29 AM PST | 02/22/2024 10:03 PM PST | |
A18 | email18 | 01/01/2024 10:30 AM PST | 01/26/2024 2:22 PM PST |
Solved! Go to Solution.
Thanks @bchager. You really went above and beyond! This definitely solves it. From the perspective of a novice user, it's pretty frustrating that you have to write out such a complicated function to arrive at something that appears so simple (from your solution):
let
// Original text
Source = [#"Login/Access Time"],
// Replace the timezone abbreviation (PST) with its UTC offset (-08:00)
ReplaceTimeZone = Text.Replace(Source, "PST", "-08:00"),
// Parse the text into a DateTimeZone value
ConvertToDateTimeZone = DateTimeZone.FromText(ReplaceTimeZone),
// Remove the timezone information to convert it to a DateTime
ConvertToDateTime = DateTimeZone.RemoveZone(ConvertToDateTimeZone)
in
ConvertToDateTime
It feels like you're fixing something that should been in the app to begin with as a button, am I right (Microsoft)?
At any rate, I ended up converting the data in Excel in a new column using a single formula (applies to both date text fields where there are nonconforming formats):
=VALUE(IF(LEN(C2)=23,LEFT(C2,19),"null"))
Then I just changed the field type to date with appropriate format, and brought back into PowerBI.
Perhaps if I need to connect to a much larger data set where preparing in Excel isn't an option, this formulaic approach will be better. I definitely learned a lot! I really appreciate your time!
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |