Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago

Different date formats in the same column

The source source is folders with csv files. There are many! 1 CSV file per day, since 2020.

It happens that some of those files have the date column written in these 2 ways:

  • Some are written like this: month-day-year
  • and others are like this: day-month-year

The correct format that PBI detects when converting the column as a data type "Date", is: month-day-year.

So when I put the column as the date data type, it throws me errors when I load.

For example : there are dates that the source files are written like this:

  • 13/11/2022 -> this date should be interpreted by PBI as 13 Nov 2022. But PBI reads it as month-day-year, that is: 13(month)- 11(day)-2022(year), and this is where it obviously shows the error, because 13 is not a month.
  • there may be other dates where maybe it is not an error, because they are written like this: 12/11/2022, where the correct thing is that PBI interprets it as November 12, 2022, but it is reading it as with December 11, 2022.

How can I do this transformation, considering that in the same column, the dates are written in 2 ways?

Thanks in advance.

The dataset is very large, and you could not change it in the original files.

3 Replies