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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Orstenpowers
Post Patron
Post Patron

Text date into real date???

Good Morning everybody,

 

The below, highlighted date column is formatted as text. When trying to change the format into date, I got the error message that this cannot be done automatically!?

What do I need to do? Hopefully someone out there that can help me!? Looking forward to your ideas I remain

 

Screenshot_016.JPG

 

I guess it is an easy one, but I don't get it.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Orstenpowers ,

 

Here we go:

year = var year = RIGHT('Table'[Order Date],4)
var month =MID('Table'[Order Date],4,2)
var day =LEFT('Table'[Order Date],2)
return
date(year,month,day)

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

6 REPLIES 6
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Orstenpowers ,

 

i would also prefer the power query away from @Ashish_Mathur .

If there are value errors in the column, they can be easily identified.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, selecting date works just fine for me.  See these screenshots

Untitled.pngUntitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

Hi @Orstenpowers ,

 

Here we go:

year = var year = RIGHT('Table'[Order Date],4)
var month =MID('Table'[Order Date],4,2)
var day =LEFT('Table'[Order Date],2)
return
date(year,month,day)

Capture.PNG

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
amitchandak
Super User
Super User

Create a new date column like

New order date = mid(Table[Order Date],4,2) &"/"& left(Table[Order Date],2) & "/" & right(Table[Order Date],4)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  Thank you!
However, it did not work. The result was a text formatted column and when I tried to change this to "Date" format, the whole column stated "error"!? 

@Orstenpowers 

Check the first three column giving correct values, if note share date for which it is not doing. If yes, then try the fourth one

 

year =right(Table[Order Date],4)
month =mid(Table[Order Date],4,2)
day =left(Table[Order Date],2)
new date =date(right(Table[Order Date],4),mid(Table[Order Date],4,2) ,left(Table[Order Date],2))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors