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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
GabrielK
New Member

Date Format

Hi, I have brought in an excel spread sheet as a data source. I have a date column, which is formated to short date in the excel sheet, but when i try change this column's type in the query editor from number to date, then all the dates in the column shows error. Please can someone assist. 

4 REPLIES 4
GabrielK
New Member

Hi Thanks for advise, unfortunately it did not work. Here is a snapshot of my problems. I have imported an excel spreadsheet to power BI, and power bi converts the durations into dates and I have tried chaning the type both in excel and power bi, but nothing works. 

GabrielK_0-1718980238636.png

Is there something im missing? 

You have several problems that I can see:

  • Your table headers in Excel occupy two (2) rows, but you are only promoting a single row to be the headers, so your first row in PQ is text and return an error when you try to set non-text data types.
    • In Excel, (or you could do this in PQ), change your headers so they are all in a single row. You can include a linefeed character for readability if you wish
  • In the Changed Type step, ensure you have the correct data types and culture setting.
    • You can edit this in either the formula bar in PQ, or the Advanced Editor
    • The Date columns, if they include the time, should be type datetime
      • If the show only a date, type date
    • The Duration columns should be type duration
    • The Climbing m column should be type number
    • The Culture argument should refer to some country that uses <space> as the thousands separator and <dot> as the decimal separator, since that is what you show in your data
      • Not knowing where this data comes from, "pt-PT" (portugal) is an example culture argument that seems to work, even though they use <comma> for the decimal.
      • The list of cultures that use <space> for thousands, <dot> for decimal, "/" for dates: 

ronrsnfld_0-1719066806488.png

 

 


Good luck.

Anonymous
Not applicable

Hi @GabrielK ,

 

Try using local:

vcgaomsft_0-1717983453337.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Sahir_Maharaj
Super User
Super User

Hello @GabrielK,

 

One approach is to create a new column for the date conversion:

ConvertedDate = 
VAR DateAsText = FORMAT([YourDateColumn], "0000-00-00")
RETURN
DATE(
    VALUE(MID(DateAsText, 1, 4)),
    VALUE(MID(DateAsText, 6, 2)),
    VALUE(MID(DateAsText, 9, 2))
)

Alternatively, if your date column is stored as a number:

ConvertedDate = 
DATE(1899, 12, 30) + [YourDateColumn]

Hope this helps - Alternatively, lets connect and I can guide you through the process - Yes, its FREE 🙂

 (https://topmate.io/sahirmaharaj/649292)


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.