Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
How do i change the YYYY-MM-DD format shown in the picture to match the YYYYMM format also shown in the picture?
Thanks
Solved! Go to Solution.
You can transform the column twice to get your result. The first to replace the "-" with "" and the second to extract the first 6 characters.
Here's an example. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtI1MNQ1MjJQitWB8A2MlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","-","",Replacer.ReplaceText,{"Column1"}),
#"Extracted First Characters" = Table.TransformColumns(#"Replaced Value", {{"Column1", each Text.Start(_, 6), type text}})
in
#"Extracted First Characters"
Pat
You can transform the column twice to get your result. The first to replace the "-" with "" and the second to extract the first 6 characters.
Here's an example. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtI1MNQ1MjJQitWB8A2MlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","-","",Replacer.ReplaceText,{"Column1"}),
#"Extracted First Characters" = Table.TransformColumns(#"Replaced Value", {{"Column1", each Text.Start(_, 6), type text}})
in
#"Extracted First Characters"
Pat