Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone,
How do I go about changing a YYYYMMDDHHHH into a yyyy-mm-dd format.
Ticket date |
201605010000 |
201702280000 |
201605080000 |
201702260000 |
Solved! Go to Solution.
The MID function can help simplify things a bit
DATEVALUE(
LEFT(Table1[Ticket date], 4) &"-"&
MID(Table1[Ticket date], 5, 2) &"-"&
MID(Table1[Ticket date], 7, 2)
)
The MID function can help simplify things a bit
DATEVALUE(
LEFT(Table1[Ticket date], 4) &"-"&
MID(Table1[Ticket date], 5, 2) &"-"&
MID(Table1[Ticket date], 7, 2)
)
I keep getting this error "Cannot convert value '--' of type Text to type Date."
That sounds like you've got some blanks date strings it's trying to interpret.
Hi @bouyazbekj
One option below. I am not sure if there are built-in functions in DAX that do this. There might.
Calculated column (setting seconds to 0)
Table1[Date] = VAR VYEAR = LEFT ( Table1[Ticket date]; 4 ) VAR VMonth = RIGHT ( LEFT ( Table1[Ticket date]; 6 ); 2 ) VAR VDay = RIGHT ( LEFT ( Table1[Ticket date]; 8 ); 2 ) VAR VHour = LEFT ( RIGHT ( Table1[Ticket date]; 4 ); 2 ) VAR VMins = RIGHT ( Table1[Ticket date]; 2 ) RETURN DATE ( VYear; VMonth; VDay ) + TIME ( VHour; VMins; 0 )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |