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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
maracles
Resolver II
Resolver II

How to replicate a Excel text-to-column date conversion

 

I export data from one of our services and the dates come out in mm/dd/yyyy format.  In Excel 2016 I can convert this very easily to dd/mm/yyyy in place without having to create any new columns. This is done by:

1. Text to columns
2. Uncheck delimiters
3. Choose 'Dates' and choose your appropriate format, see below:


date_conversion.png

 How would I replicate this in Power BI? At the moment I'm having to do the conversion in Excel before I import which is frustrating. I could somehow split columns at the "/" and then recombine but this seems too much work.  Any simpler suggestions?

Thanks.

1 ACCEPTED SOLUTION

 

there's a simpler way to do it via the PQ GUI:
right-click the column and then go Change Type => Using Locale...
then in the Dialog box select Date for Data Type and English (United States) for Locale

this should do the trick 🙂

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

In your data model, click on the column. Click on "Modeling" tab. Under data type, click on "Format" drop down and choose the format that you want.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Sean
Community Champion
Community Champion

Hi @Sean thanks for this, I had thought about doing it this way just figured there might be a simpler way! I'll use this method for now until they improve the basic functionality. Much appreciated. 

 

there's a simpler way to do it via the PQ GUI:
right-click the column and then go Change Type => Using Locale...
then in the Dialog box select Date for Data Type and English (United States) for Locale

this should do the trick 🙂

@radpir Thank you for this, from your answer I managed to find a solution. I actually had to add a step which was to convert my column to text format first, and then use Change Type > Using Locale but after that it worked perfectly. 

@Greg_Deckler Thank you for your suggestion, that would also have worked however @radpir solution allows me to do it earlier in the ETL process.

Thank you both. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.