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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

problem with date format

Hello,

 

I am working with dates that are stored as text. I changed the type to date/time but not all the cell are translated to date/time.

enath_nakash_1-1599721084611.png

I have error in the power bi transform data with this kind of cell 43562.09275

 

When I try to do it in the excel via Format custom, it does work, like in the picture:

enath_nakash_0-1599720920340.png

 

I tried to do custum colum in power bi with custumed= FORMAT([Time], "mm/dd/yyyy hh:nn:ss AMPM"), 

enath_nakash_3-1599721263410.pngwhen I do this

 

but I got this:

enath_nakash_2-1599721233054.png

 

 

What should I do in the transform data to get all the date time to be in the right format?

Thanks a lot with this!

1 ACCEPTED SOLUTION
edhans
Super User
Super User

This should work @Anonymous in a new custom column in Power Query

 

try DateTime.FromText([Column1]) otherwise DateTime.From(Number.From([Column1]))

 

edhans_0-1599736038068.png

Then just rename it Date, and change the format to DateTime or Date if you don't care about the time. Make sure the first column is in text. You have data coming in in different formats so Power Query cannot do one single change to all of it to work as you'd like. 

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

6 REPLIES 6
edhans
Super User
Super User

This should work @Anonymous in a new custom column in Power Query

 

try DateTime.FromText([Column1]) otherwise DateTime.From(Number.From([Column1]))

 

edhans_0-1599736038068.png

Then just rename it Date, and change the format to DateTime or Date if you don't care about the time. Make sure the first column is in text. You have data coming in in different formats so Power Query cannot do one single change to all of it to work as you'd like. 

 

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

it works 

thanks a lot

Great @Anonymous - glad I was able to assist.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
amitchandak
Super User
Super User

@Anonymous , if data is coming from excel. Correct the format there and try. Seems not all in same format at sources.

 

What is data source ?

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

I don't want to make changes via ecel , only via power bi so it will be automatic when I will get more

@edhans , @ImkeF , Can you suggest come code for this. Values are in excel date format - both number(date as number) and date

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.