Forum Discussion
Headers Power Query
@PowerBI123456
Después de promocionar el encabezado, vaya y agregue el siguiente código, solo cambiará el nombre de la primera columna:
Table.RenameColumns(#"Promoted Headers",{{Table.ColumnNames(#"Promoted Headers"){0}, "Source.Name"}})
Puede pegar este código en una consulta en blanco y comprobar los pasos:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCs7PTVVwSSxJVNJRcstMzUlRyEvMTQVyPP0igKRHcIBSrE60kiGQbQTExkBsAhYxBbLMgNgciC2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, #"TrasnformFile Column 1" = _t, #"TrasnformFile Column 2" = _t, #"TrasnformFile Column 3" = _t]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
Custom1 = Table.RenameColumns(#"Promoted Headers",{{Table.ColumnNames(#"Promoted Headers"){0}, "Source.Name"}})
in
Custom1Después
Aprendido de @ImkeF
________________________
Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla
Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂
- PowerBI1234565 years agoPost Partisan
Fowmy Thanks! I am actually trying to do the inverse. I am trying to promote the first row as a header for all columns except the first column. Hope that makes sense.
- AllisonKennedy5 years agoCommunity Champion@PowerBI123456 no puede promocionar solo algunos encabezados, lo que provocaría discordancia en las filas de datos, por lo que esencialmente tiene que promocionar TODOS los encabezados y, a continuación, cambiar el nombre de la primera columna. ¿Espero que tenga sentido?
- Fowmy5 years agoSuper User
In that case, what do you want to do with the first value of the first column?
You can rename all the columns with the values of the first row except the first column, then I what would be the next step!?
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂