Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Transponer una columna excepto primero

Tengo una tabla como abajo.

srmadhav_0-1594486403809.png

Me gustaría cambiar esto a:

Columna1: Columna2 Columna3 Columna4 Columna5

213 86 2

446 83 4 2 6

3 REPLIES 3
kentyler
Solution Sage
Solution Sage

Parece que podría entrar en la consulta de energía y pivotar la tabla en la columna uno, lo que le daría una columna cada uno para los diferentes valores.

Parece que no quieres pivotar en la columna 2, deberías poder dejarlo en paz cuando hagas el pivote en la columna 1





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Este es mi intento.

Creo que necesita agregar una columna (para indexar cada valor dentro del grupo) que se puede utilizar como columna dinámica para hacer los encabezados en la tabla final

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TY7JDcAwCAR74e1HOGySWiz330bkS5rfjGBhexdTlyJvk1Gu2OKINgcOCTCXdtirzZ0HctJbKtjA/kGSA7AyoTylATlNEv8Sp/KWGj8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"all", each _, type table [Column1=number, Column2=number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([all], "ind", 1)),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Column1", "Column2", "ind"}, {"Custom.Column1", "Custom.Column2", "Custom.ind"}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Custom", {{"Custom.ind", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(#"Expanded Custom", {{"Custom.ind", type text}}, "en-GB")[Custom.ind]), "Custom.ind", "Custom.Column2", List.Sum)
in
    #"Pivoted Column"

Consejo: para respuestas más rápidas, por favor publique los datos (no una imagen)

Anonymous
Not applicable

Muchas gracias. Esto funcionó perfecto

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors