Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not 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:
 
Kenneth_Pederse_0-1651229554175.png

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

2 ACCEPTED SOLUTIONS
AntonioM
Solution Sage
Solution Sage

Could you use the DATE function? Something like 

ORDREDATO = DATE( ORDR[ORD_AAAA], ORDR[ORD_MM], ORDR[ORD_DD] )

View solution in original post

SpartaBI
Community Champion
Community Champion

@Anonymous 

ORDERDATO = DATE(YEAR(ORDR[ORD_AAAA]),MONTH(ORDR[ORD_MM]),DAY(ORDR[ORD_DD]))



View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you very much, @SpartaBI  and @AntonioM ! It was easier than I thought. 🙂

Best regards
Kenneth Pedersen

SpartaBI
Community Champion
Community Champion

@Anonymous 

ORDERDATO = DATE(YEAR(ORDR[ORD_AAAA]),MONTH(ORDR[ORD_MM]),DAY(ORDR[ORD_DD]))



AntonioM
Solution Sage
Solution Sage

Could you use the DATE function? Something like 

ORDREDATO = DATE( ORDR[ORD_AAAA], ORDR[ORD_MM], ORDR[ORD_DD] )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.