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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
jinweitan
Frequent Visitor

¿Cómo puedo pivotar al formato de deseo

Hola

Tengo una mesa que se ve así:

IdQ1Q2Q1ComentsQ2Coments
1bienExcelente
2bienExcelente 2
3NoNoNo tan buenoMalo
4N/ABienNo se aplica.

y le gustaría hacerlo así

IdPreguntasRespuestaComentariosAnswerComments
1Q1Q1Comentsbien
1Q2Q2ComentsExcelente
2Q1Q1Comentsbien
2Q2Q2ComentsExcelente 2

.

.

.

¿Hay algo posible en hacer eso?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jinweitan , En Power Query tienes que despivot

referirse https://radacad.com/pivot-and-unpivot-with-power-bi

Es posible que tenga que despotable dos veces - https://kohera.be/blog/power-bi/how-to-unpivot-twice/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
nandukrishnavs
Community Champion
Community Champion

@jinweitan

Seleccione Q1Comments y Q2Comments en Editar consulta y haga clic en el botón Unpivot.

nandukrishnavs_0-1597656120835.png

Aquí está PowerQuery para su referencia.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUYpMLYaT7vn5KUDKtSI5NScnNa9EKVYnWsmIgCIFI7AyY6CYXz6CKFEozldIh6h1SkwBqzGBG+Kn7wgk/bMTK6GKEwsKcjJTU/SUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Q1 = _t, Q2 = _t, Q1Comments = _t, Q2Comments = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Q1", type text}, {"Q2", type text}, {"Q1Comments", type text}, {"Q2Comments", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ID", "Q1", "Q2"}, "Attribute", "Value")
in
    #"Unpivoted Columns"


Regards,
Nandu Krishna

amitchandak
Super User
Super User

@jinweitan , En Power Query tienes que despivot

referirse https://radacad.com/pivot-and-unpivot-with-power-bi

Es posible que tenga que despotable dos veces - https://kohera.be/blog/power-bi/how-to-unpivot-twice/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hola @jinweitan ,

1. Haga clic en el botón "Transformar datos" para entrar en la página Editor de Power Query.

2. Elija la tabla de la izquierda y haga clic con el botón derecho en la columna ID.

3. Elija Despivot otras columnas.

How do I pivot to desire format.PNG

Es posible que deba duplicar la tabla y despomparete por separado.

A continuación, utilice la función merge para obtener lo que desea tabla.

Por favor, inténtelo.

Aiolos Zhao

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.