Forum Discussion
Transforming text to date
- 1 year ago
Right click a cell then click Replace Value. Replace UTC with nothing.
Change the type to datetime. If you need just the date, change it to type date after changing to datetime. Power Query will return an error if you change it to date directly.
Right click a cell then click Replace Value. Replace UTC with nothing.
Change the type to datetime. If you need just the date, change it to type date after changing to datetime. Power Query will return an error if you change it to date directly.
Hi PowerBINoob24 ,
Thank you for reaching out to the Microsoft Community Forum.
This issue is common when working with datetime strings that include time zone indicators like "UTC". Power BI reads such strings as text, and the "UTC" suffix can prevent automatic conversion to a proper datetime format.
Please follow below steps to fix the issue.
1. Created table "Table" with sample data. please refer below snap.
2. In Power Query editor, Add column --> Custom column , and use below code. refer below snap.
3. Custom column "Custom" was created and then select the custom column and change the data type to "Date/Time". refer the snap.
4. converted the custom column from "text" to "Date/Time" format. Please refer the output snap and attached PBIX file.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh