Forum Discussion
Can't convert text to date
- 7 years ago
That's interesting because I was able to transform the exact same string to a date using the Power BI Transform functionality.
However, you could add a calculated column that does the transformation
DateColumn = DATE( LEFT('Table'[DateString],4, MID('Table'[DateString],5,2), RIGHT('Table'[DateString],2))You have to make sure that the string always has the same format YYYYMMDD.
Hope this helps
JJ
That's interesting because I was able to transform the exact same string to a date using the Power BI Transform functionality.
However, you could add a calculated column that does the transformation
DateColumn =
DATE(
LEFT('Table'[DateString],4,
MID('Table'[DateString],5,2),
RIGHT('Table'[DateString],2))You have to make sure that the string always has the same format YYYYMMDD.
Hope this helps
JJ
I had the same problem, date/time data in text format, getting the same error when trying to change the format. My mistake was to try to change the format in the Home panel. Once I entered the Power Query Editor, I was able to 'Change type', by right-clicking the column header. Worked perfectly, no need to write a measure or create a new column.