Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola, aprecio un consejo. Tengo un año en formato de texto y también mes en formato de texto (2 dígitos). ¿Cuál es la manera de convertir a fin de mes (en lenguaje M). Gracias
Solved! Go to Solution.
Hola @albertan
con datos de muestra simulados puede hacerlo de la siguiente manera:
// Table
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlDSUTKwVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Month = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", type text}, {"Month", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each Date.EndOfMonth(#date(Number.From([Year]),Number.From([Month]),1))),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Date", type date}})
in
#"Changed Type1"
No te molestes con el formato de fecha que está localizado.
Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)
Hola @albertan
con datos de muestra simulados puede hacerlo de la siguiente manera:
// Table
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlDSUTKwVIqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Month = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", type text}, {"Month", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each Date.EndOfMonth(#date(Number.From([Year]),Number.From([Month]),1))),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Date", type date}})
in
#"Changed Type1"
No te molestes con el formato de fecha que está localizado.
Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |