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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
zap2zero
Helper I
Helper I

Handling two date formats

Hello,

 

I have a kinda big PowerBI file where about a dozen tables are based on one Folder of CSV files. The system providing these CSV files now switched the date column from DD.MM.YYYY to YYYY-MM-DD for new files.

 

Whats the best and easiest way to make it possible to handle both date formats so its no difference whether a new or old file is processed?

 

Harry.

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @zap2zero 

Please correct me if I wrongly understood your question.

 

If each file has a different format type in the DATE column, then, in my opinion, the best way to deal with it is by using Power Query in Power BI and change it by using the option LOCALE. This will make all files have a standard format in the DATE column.

 

Picture4.pngPicture5.png

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @zap2zero ,

 

According to your question, I think the conversion can be realized quickly in powerbi desktop. You can create a column on the desktop and use format to customize the date type. The format type to achieve a unified multi-file date is as follows:

v-henryk-mstf_0-1617695314350.png


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jihwan_Kim
Super User
Super User

Hi, @zap2zero 

Please correct me if I wrongly understood your question.

 

If each file has a different format type in the DATE column, then, in my opinion, the best way to deal with it is by using Power Query in Power BI and change it by using the option LOCALE. This will make all files have a standard format in the DATE column.

 

Picture4.pngPicture5.png

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@zap2zero , bring them as text , Create a new column in dax and mark as date

if(search("-",[Column],,0) >0 , Date(left([Column],4) ,Mid([Column,4],6,2), right([Column],2)) ,

Date(right([Column],4) ,Mid([Column,4],4,2), left([Column],2)) )

 

In power Query you do have Start, Middle and end , in case you want to do in power query refer (index start from 0 there)

https://youtu.be/vky4wPqm0O0

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.