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

Different date formats in the same column

Hello. I have a table with a date column. But it has different formats and it's stressing me out. It's like in the example.

 

01-07-2021Januari 7th 2021
01-07-20211st of july 2021

 

How can I fix this. I already searched the entire community and nothing helped me. Thanks in advance

1 ACCEPTED SOLUTION
VijayP
Super User
Super User

@Anonymous 

in Power QUery Editor Create another Column Indicating the Date Format like US / UK (let us say Name of the column "Format") , 

For example in your sample Data first Date is of US Format and  Second Date UK Date
Then Split the Date column by Delimiter
Then Combine the Dates using this Formula using Custom Column option
if [Format]="USA" then #date( Third Split column ,first split column, second splitcolumn) else
#date(third split column,second split Column, First Split Column)

Use the attached file for idea!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

8 REPLIES 8
negi007
Community Champion
Community Champion

@Anonymous You can split the value of the column into two different column. You can use powerquery window for spliting the data. One column can have valid date data and other column can have text which is same as your date. 

 

negi007_0-1614180126644.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

VijayP
Super User
Super User

@Anonymous 

in Power QUery Editor Create another Column Indicating the Date Format like US / UK (let us say Name of the column "Format") , 

For example in your sample Data first Date is of US Format and  Second Date UK Date
Then Split the Date column by Delimiter
Then Combine the Dates using this Formula using Custom Column option
if [Format]="USA" then #date( Third Split column ,first split column, second splitcolumn) else
#date(third split column,second split Column, First Split Column)

Use the attached file for idea!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

This works on small scale. But how would i get the format uk or us for 60.000 rows?

 

 

@Anonymous 

In the Data there should be some general logic which can decide us or uk format, if you could share 2 or 3 rows of teh data from 60000 rows , i can help you! you can share thru email as well

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

Thanks, but i found something

Anand24
Super User
Super User

Hi @Anonymous ,

You can't have different date formats in the same date column in Power BI. A column like this would be text column. What you can probably do is have 2 different date columns with one format each.

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

Anonymous
Not applicable

This is correct, but how would i do that

@Anonymous ,

PFA pbix. I have created 2 new columns with one date format each. Date3 and Date4 are the calculated date columns.

Note: The formats you have specified are not available as Date Formats in Power BI. You can have that format but then the field would be text field and not date field. You won't be able to perform date functionalities with those text format.

Below Date formats are available:

dates.JPG

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

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.