Forum Discussion
Anonymous
6 years agoNot applicable
Dateformat
Hello everyone, Can anyone help me to convert this text column into a date column? The text value looks like this 15-FEB-20 11.00.00.000000 PM.
- 6 years ago
Hi Anonymous
if you need exactly DAX, not M formula use:
a. for only date
ColumnDate = DATEVALUE(FORMAT(LEFT([Columntext],9),"General Date"))b. for the datetime column
ColumnDateTime = var _date = DATEVALUE(FORMAT(LEFT([Columntext],9),"General Date")) var _time = TIMEVALUE(SUBSTITUTE(RIGHT([Columntext],LEN([Columntext])-10),".000000", "")) RETURN _date + _time
az38
6 years agoCommunity Champion
Anonymous
do you have empty cells with data? if so, how do you want to calculate it? what date it should return?
Anonymous
6 years agoNot applicable
I have a column with date values like this one: "15-FEB-20 11.00.00.000000 PM." but they are formated as text and not date/time. I want to format the column from text to date/time.
- az386 years agoCommunity Champion
Anonymous
yes, but error "Cannot convert value '' of type Text to type Date." says to me that it is possible that you have an empty cells in your Date column. How do you plan to perform empty cells?
- Anonymous6 years agoNot applicable
Aaaaah! Yes now it works! I didnt see the blank cell.. Thank you!