Forum Discussion
Anonymous
4 years agoNot applicable
Conversion of dates
Dear all,
I have a table containing the order date in three separate fields: date, month and year.
I have tried to use :
ORDREDATO = COMBINEVALUES(".",ORDR[ORD_DD],ORDR[ORD_MM],ORDR[ORD_AAAA])
Unfortunately, this is failing because PowerBI does not recognize one character dates and months as a valid date format and the conversion to date fails:
In english the error message is: Can not convert the value 10.1.2019 for type Text to type Date.
I guess I have to add a leading zero before the "1" in the example. Any ideas?
Best regards
Kenneth Pedersen
Could you use the DATE function? Something like
ORDREDATO = DATE( ORDR[ORD_AAAA], ORDR[ORD_MM], ORDR[ORD_DD] )Anonymous
ORDERDATO = DATE(YEAR(ORDR[ORD_AAAA]),MONTH(ORDR[ORD_MM]),DAY(ORDR[ORD_DD]))