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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JuSlaughter
New Member

NOOB - Beginning Power BI Book DateTime Error

Hi

 

First post so please be gentle.

 

I am looking into Power BI after using Excel and Reporting Services for quite a few years. I have purchased the Beginning Power BI book and am working through it with no issues......until I get to Chapter 9.

 

I have imported a provided CSV file. It opens OK and one of the instructions is to make sure the 3 Date columns are actually set to DateTime. They aren't, they are text. So I selected Data Type Date\Time on one of the columns but it returns errors for most of the values.

 

The dates are formatted as 09/18/2017 08:00:55 AM or 09/10/2017 02:38:59 PM. It appears that the errors only occur on the AM date times.

 

Any suggestions on how I get round this issue, bearing in mind I only started looking at this today ;o)

 

Thanks

 

Ju

7 REPLIES 7
JuSlaughter
New Member

Hi @JuSlaughter,

 

I test on your data but can't reproduce the issue which you mentioned. I think the issue is related to the date format.(for instance: UK date and US date)

 

I'd like to suggest you to add a custom column to transfer these date to your locale date format, it may work through your issue.

Sample:

 #"Added Custom" = Table.AddColumn(#"Changed Type", "Opened(US)", each DateTime.FromText(Text.From([Opened]),"us"))
 #"Added Custom" = Table.AddColumn(#"Changed Type", "Opened(UK)", each DateTime.FromText(Text.From([Opened]),"uk"))

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Sorry for the delay, been stuck doing the day job and now I'm on holiday for a few weeks. Will have a look when I get back and let you know.

 

Thanks for your help.

 

Cheers

Hi

 

Thanks for the response. I will give it a try although I dont fully understand at this stage of my learning where the code you have supplied should go but I will try and figure it out.

 

Thanks

JuSlaughter
New Member

Morning, what is the best way to link a file on this forum?

 

Thanks

v-shex-msft
Community Support
Community Support

Hi @JuSlaughter,

 

Please share sample csv file to test, it will be help for troubleshooting.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Greg_Deckler
Super User
Super User

Hmm, that's odd. I created a CSV file with those values in it and was able to successfully convert it to Date/Time data type. Can you supply a link to the CSV file?


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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