Estos son mis datos: 2 columnas originales + 1 hechas de la primera.
dejar que
Source : Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSo0pNTAwMlO2NDWzVshNLcnIT1HSUYIJmphZ6xaXFJUml5QWpSrF6kQrJefnFZck5pUowJSYGVgja7CwNjR2BhqUWAzUkZuaV6IUGWsA"let _t á ((tiponullabletrueenlatabla detipos [col1 ? _t, col2 - _t]), -
"Changed Type" - Table.TransformColumnTypes(Source, ?"col1"typetext, •"col2"texto de tipotext?),
HtmlTable - Table.AddColumn(-"Changed Type""HtmlTable", cada Html.Table([col1],? "HtmlDecoded",":root"?)),
"Expanded HtmlTable""HtmlTable"," HtmlDecoded","HtmlDecoded" , "HtmlDecoded"-
in
"Expanded HtmlTable"
No puedo encontrar una manera de transformar 2 columnas a la vez. ¿Hay uno?
Solved! Go to Solution.
Gracias, @mahoneypat .
Usando tu respuesta pude crear lo que necesitaba.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSo0pNTAwMlO2NDWzVshNLcnIT1HSUYIJmphZ6xaXFJUml5QWpSrF6kQrJefnFZck5pUowJSYGVgja7CwNjR2BhqUWAzUkZuaV6IUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [col1 = _t, col2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"col1", type text}, {"col2", type text}}),
Decoded = Table.TransformColumns(#"Changed Type", {
{"col1", each Table.FirstValue(Html.Table(_,{{"HtmlDecoded1",":root"}}))},
{"col2", each Table.FirstValue(Html.Table(_,{{"HtmlDecoded2",":root"}}))} } )
in
Decoded
Gracias, @mahoneypat .
Usando tu respuesta pude crear lo que necesitaba.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSo0pNTAwMlO2NDWzVshNLcnIT1HSUYIJmphZ6xaXFJUml5QWpSrF6kQrJefnFZck5pUowJSYGVgja7CwNjR2BhqUWAzUkZuaV6IUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [col1 = _t, col2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"col1", type text}, {"col2", type text}}),
Decoded = Table.TransformColumns(#"Changed Type", {
{"col1", each Table.FirstValue(Html.Table(_,{{"HtmlDecoded1",":root"}}))},
{"col2", each Table.FirstValue(Html.Table(_,{{"HtmlDecoded2",":root"}}))} } )
in
Decoded
Sí. La función Table.TransformColumns toma una lista de listas como argumento, cada una de las cuales es un nombre de columna y la función que se va a aplicar. A continuación, tomé su M, resalto sus dos primeras columnas y elegí minúsculas en la pestaña Transformar. Este código ahora se puede cambiar para realizar una transformación diferente en cada columna.
• Table.TransformColumns('Expanded HtmlTable','"col1", Text.Lower,type text', 'col2', Text.Lower, type text')
saludos
palmadita
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |