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

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.

Reply
Anonymous
Not applicable

Build a valid date with DATE function (dd.mm.yy)

Dear all,


I have some issues with building a valid date from this source:

Kenneth_Pederse_0-1653982065613.png

I have tried:

DATO = DATE(TRLO[TRL_DAG], TRLO[TRL_DMND], TRLO[TRL_AAR])
 
I guess the formula fails because of the two character year. Any suggestions?

Best regards
Kenneth Pedersen
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

30 in the TRLO[TRL_DAG] stands for 2030, right?

Adding two digits to 2000 turns it into a four-digit year.

 

DATO = DATE(2000+TRLO[TRL_DAG], TRLO[TRL_DMND], TRLO[TRL_AAR])

 

vstephenmsft_0-1654243021971.png

Then you can change the format you want.

vstephenmsft_1-1654243041901.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

30 in the TRLO[TRL_DAG] stands for 2030, right?

Adding two digits to 2000 turns it into a four-digit year.

 

DATO = DATE(2000+TRLO[TRL_DAG], TRLO[TRL_DMND], TRLO[TRL_AAR])

 

vstephenmsft_0-1654243021971.png

Then you can change the format you want.

vstephenmsft_1-1654243041901.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Tahreem24
Super User
Super User

@Anonymous Try this DAX Column:

Date Column = FORMAT(DATE(DateTable[Year],DateTable[Month],DateTable[Day]),"dd.mm.yy")
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Thank you very much.

I tried: 

DATO = FORMAT(DATE(TRLO[TRL_DAAR], TRLO[TRL_DMND], TRLO[TRL_DAG]), "yy.mm.dd")

and this one too:
 
DATO = FORMAT(DATE(TRLO[TRL_DAAR], TRLO[TRL_DMND], TRLO[TRL_DAG]), "dd.mm.yy")

I still get error message (in english like this): One argument in function DATE has wrong data type, or the result is too big or too small.

Best regards
Kenneth Pedersen

@Anonymous Make sure all Year, Month, and Day columns are of type interer or whole number. They should not be a text column.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , Not very clear.

In the date function DATE you should give Year, month , date

 

Ate you giving those values ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.