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
Uddhavchitre
Frequent Visitor

Converting text into date

Hello,
I have fetched ata from data source as text. In the power Query I want to conver it into a date

in the first row actual date 2024-10-01 and in the second row 2024-09-01

I tried to use date.Fromtext function but it is giving an error

Uddhavchitre_0-1677074762062.png

Help is really appreaiate. @amitchandak @Greg_Deckler @Ashish_Mathur 

 

Thank you so much in advance.

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

I just changed the data type and it worked fine.  See the images below

Untitled.pngUntitled1.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Thennarasu_R
Responsive Resident
Responsive Resident

Hi @Uddhavchitre 
You could use ,

CONVERT Dax Function.
it will crack your queries

Thanks,
Thennarasu 

MAwwad
Super User
Super User

The Date.FromText function expects the text date to be in a specific format.

To convert the text date in the format "2024-10-01" into a date in Power Query, you can try the following steps:

  1. Select the column with the text dates.
  2. Go to the "Transform" tab in the Power Query Editor.
  3. Click on the drop-down arrow next to the column header and select "Date".
  4. Select "Using Locale" and then choose the appropriate locale for your date format (e.g., "en-US" for "mm/dd/yyyy" or "en-GB" for "dd/mm/yyyy").
  5. In the "Date and Time" dialog box, select "Custom" and then enter the date format that matches the text dates in your data source (in this case, "yyyy-MM-dd").
  6. Click "OK" to convert the text dates to date values.

If you still encounter issues with the conversion, please provide me with more details about the error message that you are receiving, and the steps that you have followed so far.

Thank you so much for you reply @MAwwad 

I could follow till step no. 4

It would be really nice if you can explain the step 5 with more details.

I am attaching current screen shot of the power query page

Uddhavchitre_0-1677076748299.png

 

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.