cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsabsi
Advocate I
Advocate I

How to convert text (data type) to a date (data type)?

Hello guys, 

 

I need your help with converting a text column towards a data type. 

Should i add a column with a certain formula to achieve this? 

 

See below the error that I'm getting from this: 

Verzoek Chris.JPG

Many thanks!!!

 

Cheers,

 

DSabsi 

 

 

 

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

Sure (I included some Dutch as well 🙂 😞

 

let
    Source = #table(type table[Verwachte_Start = text],{{"1499032800"},{"1498860000"},{"1493589600"},{"1491170400"}}),
    AddedUTCDateTime = Table.AddColumn(Source, "Verwachte_startdatum/tijd_UTC", each #datetimezone(1970,1,1,0,0,0,0,0) + #duration(0,0,0,Number.From([Verwachte_Start])), type datetimezone),
    AddedLocalDate = Table.AddColumn(AddedUTCDateTime, "Verwachte_startdatum_lokaal", each Date.From([#"Verwachte_startdatum/tijd_UTC"]), type date)
in
    AddedLocalDate
Specializing in Power Query Formula Language (M)

View solution in original post

13 REPLIES 13

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors