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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
beaverbuzz85
Regular Visitor

Troubleshooting Simple Conversion of String to Date

Hello, 

 

I am trying to solve a seemingly simple issue. I am trying to convert the following to a year.

 

1999/2000 to 2000. 

 

1999/2000 (string)

 

My calculated column is this: 

Tax Year = RIGHT('Year'[Financial Year],4)
 
But after I try to convert that calculate column to "Date" it returns this error:
 
"Cannot convert value '2000' of type Text to type Date."
 
Thank you for the help!
4 REPLIES 4
SamInogic
Super User
Super User

Power BI allows the DATEVALUE DAX formula with parameter as Text, which includes date value in MM/DD/YYYY format, so you need to add the below expression:

 

DateVal = DATEVALUE("01/01/" & RIGHT("1999/2000", 4))

Please refer to the below screenshot for the same.

 

Power BI.jpg

 

Thanks!

Inogic

Innovative Logic  

Web: www.inogic.com/services/

Blog: http://www.inogic.com/blog

twitter: @inogic

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/
FreemanZ
Super User
Super User

Date format needs the complete set of YYYY-MM-DD, but you only have YYYY.  You can set it as text. 

Thanks for the clarification. 

 

I understand that you can't forecast with a basic line chart while the x-axis is text (i.e. the supposed year as you have described). 


Could you please confirm?

amitchandak
Super User
Super User

@beaverbuzz85 , in case you need a date

 

Tax Year  date= date( RIGHT('Year'[Financial Year],4),1,1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.