Forum Discussion
Anonymous
7 years agoNot applicable
Can't convert text to date
Hi guys, I am newbie in powerbi I have this column with dates like '20180101' which is supposed to be 2018-01-01. I tried converting it in the modelling but received this error message. "...
- 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
Ktoce
3 years agoFrequent Visitor
I had exact same issue as OP. I was able to change the type from number to text in one step and then change type from text to date in next step. Makes no sense at all but it worked.