Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
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
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
When i try to run the formula i get this error:
"Cannot convert value '' of type Text to type Date."
Do you have any solution for this?
@Anonymous
do you have empty cells with data? if so, how do you want to calculate it? what date it should return?
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.
@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?
Aaaaah! Yes now it works! I didnt see the blank cell.. Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |