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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Arul
Super User
Super User

Date Conversion

Hi All,

 

Could one help me on how to convert the below attached text column into proper date time either in Power query editor or in DAX?

Arul_0-1626935008339.png

 

Thanks,

-Arul

 





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

Proud to be a Super User!


LinkedIn


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Arul ,

 

Try this calculated column

Column =
VAR _y =
    RIGHT ( [Date], 4 )
VAR _d =
    RIGHT ( LEFT ( [Date], 10 ), 2 )
VAR _mon =
    SWITCH (
        LEFT ( [Date], 3 ),
        "Jan", 1,
        "Feb", 2,
        "Mar", 3,
        "Apr", 4,
        "May", 5,
        "Jun", 6,
        "Jul", 7,
        "Aug", 8,
        "Sep", 9,
        "Oct", 10,
        "Nov", 11,
        "Dec", 12
    )
VAR _h =
    RIGHT ( LEFT ( [Date], 13 ), 2 )
VAR _min =
    RIGHT ( LEFT ( [Date], 16 ), 2 )
VAR _s =
    RIGHT ( LEFT ( [Date], 19 ), 2 )
RETURN
    DATE ( _y, _mon, _d ) + TIME ( _h, _min, _s )

7.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Arul ,

 

Try this calculated column

Column =
VAR _y =
    RIGHT ( [Date], 4 )
VAR _d =
    RIGHT ( LEFT ( [Date], 10 ), 2 )
VAR _mon =
    SWITCH (
        LEFT ( [Date], 3 ),
        "Jan", 1,
        "Feb", 2,
        "Mar", 3,
        "Apr", 4,
        "May", 5,
        "Jun", 6,
        "Jul", 7,
        "Aug", 8,
        "Sep", 9,
        "Oct", 10,
        "Nov", 11,
        "Dec", 12
    )
VAR _h =
    RIGHT ( LEFT ( [Date], 13 ), 2 )
VAR _min =
    RIGHT ( LEFT ( [Date], 16 ), 2 )
VAR _s =
    RIGHT ( LEFT ( [Date], 19 ), 2 )
RETURN
    DATE ( _y, _mon, _d ) + TIME ( _h, _min, _s )

7.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Arul , A new column like in Power Query

DateTime.FromText(Text.combine({ Text.Middle([column],8,2)," ", Text.Middle([column],4,3), Text,Right([column],4),Text.Middle([column],11,8)}))

 

Adjust start index in middle if needed, like 8 can be 9

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.