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

How to convert dd.mm.yyyy to dd/mm/yyyy?

Hello,

I have a column of dates imported from an Excel sheet into Power Query within Power BI. The column has dates in two different formats: dd.mm.yyyy and dd/mm/yyyy. When changing the column type from text to date, it only recognizes the dates in the format dd/mm/yyyy but for the dates in the format dd.mm.yyyy it just shows error. How to convert all the dates in the correct format dd/mm/yyyy without errors? Any help is much appreciated!

MakeItReal_1-1655631014590.png

Changing type to Date:

MakeItReal_0-1655630994914.png

Source data from Excel:

Day
03.01.2021
03.01.2021
04.01.2021
04/01/2021
04/01/2021
04/01/2021
05/01/2021
05/01/2021
08/01/2021
08/01/2021
08/01/2021
08/01/2021
08/01/2021
08/01/2021
10/01/2021
10/01/2021
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I changed the Date - Locale - English (UK) for the column in PQ but it didn't work. However, i changed the Regional settings and it worked!

MakeItReal_0-1655634224404.png

 

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

if your default date format of PQ is dd/mm/yyyy then it will automatically give the right output when you selecte Date data type.

Otherwise, you can use Locale English(UK) to convert this into dd/mm/yyyy column. You will need to click ABC123 in your column heading - Using locale - Data type, select Date - Locale - English (UK)

If above doesn't work for you, replace . with / by selecting column - Transform - Replace values - Value to find will be . and Replace with will be /

Then you can convert the column to Date.

OR

You can use following formula in a custom column

=Date.From([Day])

OR

=try Date.From(Text.Replace([Day],".","/")) otherwise Date.From([Day])

Anonymous
Not applicable

I changed the Date - Locale - English (UK) for the column in PQ but it didn't work. However, i changed the Regional settings and it worked!

MakeItReal_0-1655634224404.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.

Top Solution Authors
Top Kudoed Authors