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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Prasanthke
Frequent Visitor

Date/Time

how to convert the date/time columns in text data type to data and time columns seperately

 

10-10-2017 21:25

 

3 ACCEPTED SOLUTIONS
Riny_vE
Frequent Visitor

PQ should recognise such a text and be able to set the data type to Date/Time.

Riny_vE_2-1748079863586.png

 

Then, on the Add Column Ribbon and choose Date, Date Only in the From Date & Time group. Repeat that step for the time portion (Time, Time Only).

Riny_vE_0-1748079776872.png

Riny_vE_1-1748079783455.png

 

 

 

 

View solution in original post

Jai-Rathinavel
Super User
Super User

Hi @Prasanthke , Just replace your source query and DateTimeColumn in the below M Code

let
    Source = YourTable,
    DateColumn = Table.AddColumn(Source, "Date", each Date.From(Text.From([DateTimeColumn]))),
    TimeColumn = Table.AddColumn(DateColumn, "Time", each Time.From(Text.From([DateTimeColumn])))
in
    TimeColumn

 

Thanks,

Jai Rathinavel | LinkedIn




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

v-hjannapu
Community Support
Community Support

Hi @Prasanthke ,

Thank you  for reaching out to the Microsoft fabric community forum.

 

I would also take a moment to thank @Jai-Rathinavel and @Riny_vE  for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.


please gothorugh the below official Documentation hope this resolve your Issue.
https://learn.microsoft.com/en-us/powerquery-m/date-fromtext?

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team

View solution in original post

7 REPLIES 7
Omid_Motamedise
Super User
Super User

USe the following code

 

let
    Source = YourTable,
    ChangedType = Table.TransformColumnTypes(Source, {{"DateTimeText", type datetime}}),
    AddDate = Table.AddColumn(ChangedType, "DateOnly", each DateTime.Date([DateTimeText]), type date),
    AddTime = Table.AddColumn(AddDate, "TimeOnly", each DateTime.Time([DateTimeText]), type time)
in
    AddTime

If my answer helped solve your issue, please consider marking it as the accepted solution.
v-hjannapu
Community Support
Community Support

Hi @Prasanthke ,

Thank you  for reaching out to the Microsoft fabric community forum.

 

I would also take a moment to thank @Jai-Rathinavel and @Riny_vE  for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.


please gothorugh the below official Documentation hope this resolve your Issue.
https://learn.microsoft.com/en-us/powerquery-m/date-fromtext?

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team

Hi @Prasanthke,

Just wanted to check if you had the opportunity to review the suggestion provided?

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

 

Thank You.

Harshitha.

Community Support Team.

Hi @Prasanthke,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.

Thank You.

Harshitha.

Community Support Team.

Hi @Prasanthke,

May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank You.

Harshitha.

Community Support Team.

Jai-Rathinavel
Super User
Super User

Hi @Prasanthke , Just replace your source query and DateTimeColumn in the below M Code

let
    Source = YourTable,
    DateColumn = Table.AddColumn(Source, "Date", each Date.From(Text.From([DateTimeColumn]))),
    TimeColumn = Table.AddColumn(DateColumn, "Time", each Time.From(Text.From([DateTimeColumn])))
in
    TimeColumn

 

Thanks,

Jai Rathinavel | LinkedIn




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Riny_vE
Frequent Visitor

PQ should recognise such a text and be able to set the data type to Date/Time.

Riny_vE_2-1748079863586.png

 

Then, on the Add Column Ribbon and choose Date, Date Only in the From Date & Time group. Repeat that step for the time portion (Time, Time Only).

Riny_vE_0-1748079776872.png

Riny_vE_1-1748079783455.png

 

 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors