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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

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, @Anonymous 

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 @Anonymous ,

 

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, @Anonymous 

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

@Anonymous , 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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

Top Solution Authors