The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi - I have Year integer only (ie 2021) - how to turn that Year to a dd/mmm/yyy by making is say 1st date of year so all my years ared like 2020, 2021 etc turn into 01/01/2020, 01/01/2021 etc. Pref in Power Query.
any ideas ? thanks
Solved! Go to Solution.
Select that column - Transform menu - Data type - date
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlCK1QEzDGEMIzDD0NLSUik2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", type date}})
in
#"Changed Type"
Select that column - Transform menu - Data type - date
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlCK1QEzDGEMIzDD0NLSUik2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", type date}})
in
#"Changed Type"
Excellent - thanks very much