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.
Hola
Necesito reemplazar (en el editor de consultas) el nombre de todos los meses con el número del mes.
¿Cómo puedo escribir esto en un solo paso?
Ejemplo:
Saludos.
Solved! Go to Solution.
@cristianml , Prueba
Date.ToText( Date.FromText(Text.BeforeDelimiter([Column1]," " ,{1, RelativePosition.FromStart})),"MM.yyyy") & " - " & Text.AfterDelimiter([Column1]," " ,{1, RelativePosition.FromStart})
ejemplo probado
Date.ToText( Date.FromText(Text.BeforeDelimiter("December 2022 Backlog"," " ,{1, RelativePosition.FromStart})),"MM.yyyy") & " - " & Text.AfterDelimiter("December 2022 Backlog"," " ,{1, RelativePosition.FromStart})
¿Puede proporcionar algunos datos en formato de texto?
Hola @cristianml ,
Aquí está el código para hacerlo:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcklNTs1NSi1SMDIwMlRwSkzOzslPV4rViVZyS00qKk0sqgTJGKHIeCXmYZfwyy/DZlgsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Column1.1", "Text Column1.2"}),
#"RepacedMonthName" = Table.ReplaceValue(#"Split Column by Delimiter", each [Column1.1],
each List.Accumulate(List.Buffer(Table.ToRecords(MasterTable)),
[Column1.1],
( valueToReplace, replaceOldNewRecord ) =>
Text.Replace
( valueToReplace, replaceOldNewRecord[Name], replaceOldNewRecord[Number] ) ),Replacer.ReplaceText,{"Column1.1"}),
Custom1 = Table.AddColumn( #"RepacedMonthName", "RequiredColumn", each Text.Combine({Text.From([Column1.1], "es-ES"), [Text Column1.2]}, "."), type text),
#"Removed Columns" = Table.RemoveColumns(Custom1,{"Column1.1", "Text Column1.2"})
in
#"Removed Columns"
Adjuntando un archivo de muestra aquí para su referencia.
Espero que cumpla con su requisito.
Hola @cristianml ,
Aquí está el código para hacerlo:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcklNTs1NSi1SMDIwMlRwSkzOzslPV4rViVZyS00qKk0sqgTJGKHIeCXmYZfwyy/DZlgsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false), {"Column1.1", "Text Column1.2"}),
#"RepacedMonthName" = Table.ReplaceValue(#"Split Column by Delimiter", each [Column1.1],
each List.Accumulate(List.Buffer(Table.ToRecords(MasterTable)),
[Column1.1],
( valueToReplace, replaceOldNewRecord ) =>
Text.Replace
( valueToReplace, replaceOldNewRecord[Name], replaceOldNewRecord[Number] ) ),Replacer.ReplaceText,{"Column1.1"}),
Custom1 = Table.AddColumn( #"RepacedMonthName", "RequiredColumn", each Text.Combine({Text.From([Column1.1], "es-ES"), [Text Column1.2]}, "."), type text),
#"Removed Columns" = Table.RemoveColumns(Custom1,{"Column1.1", "Text Column1.2"})
in
#"Removed Columns"
Adjuntando un archivo de muestra aquí para su referencia.
Espero que cumpla con su requisito.
@cristianml , Prueba
Date.ToText( Date.FromText(Text.BeforeDelimiter([Column1]," " ,{1, RelativePosition.FromStart})),"MM.yyyy") & " - " & Text.AfterDelimiter([Column1]," " ,{1, RelativePosition.FromStart})
ejemplo probado
Date.ToText( Date.FromText(Text.BeforeDelimiter("December 2022 Backlog"," " ,{1, RelativePosition.FromStart})),"MM.yyyy") & " - " & Text.AfterDelimiter("December 2022 Backlog"," " ,{1, RelativePosition.FromStart})
¿Puede proporcionar algunos datos en formato de texto?