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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Jase68
Helper I
Helper I

Transponer una tabla

Hola Expertos en PBI

Tengo una tabla simple que necesito transponer para que las FECHAS (Año-Wk) se muevan de las filas a las columnas.

Este es mi formato actual;

Valor de MeasureID año-semana
2020-01 A 5
2020-02 A 10
2020-01 B 15
2020-02 B 20


Quiero transponer en carga para obtener los datos en una tabla que se ve así;

MeasureID 2020-01 2020-02
A 5 10
B 15 20

Lo he intentado de muchas maneras, pero no puedo conseguir que funcione. Se siente como si debería haber una respuesta simple, así que esperando que alguien pueda ayudar...

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

Consulte, si el pivote puede ayudar

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

V-pazhen-msft
Community Support
Community Support

@Jase68

Editor de consultas > Columna dinámica

Pivot.JPG

Paul Zheng
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

Vera_33
Resident Rockstar
Resident Rockstar

Hola @Jase68 seleccionar las dos primeras columnas y pivotar la columna de valor en Power Query

Capture.PNG

View solution in original post

9 REPLIES 9
Vera_33
Resident Rockstar
Resident Rockstar

Hola @Jase68 seleccionar las dos primeras columnas y pivotar la columna de valor en Power Query

Capture.PNG

Trabaja un placer - gracias!

V-pazhen-msft
Community Support
Community Support

@Jase68

Editor de consultas > Columna dinámica

Pivot.JPG

Paul Zheng
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Esto funciona - gracias!

Greg_Deckler
Super User
Super User

Aquí está la versión de Power Query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1MFTSUXIEYlOlWB2YmBFUzNAASRCk0AkkiK4SJGgEVBkLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Year-Week" = _t, MeasureID = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year-Week", type date}, {"MeasureID", type text}, {"Value", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type", {{"Year-Week", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Changed Type", {{"Year-Week", type text}}, "en-US")[#"Year-Week"]), "Year-Week", "Value", List.Sum)
in
    #"Pivoted Column"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Brillante - gracias.

Greg_Deckler
Super User
Super User

Escribí una transposición DAX una vez: https://community.powerbi.com/t5/Quick-Measures-Gallery/TRANSPOSE/m-p/630229#M314


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

Consulte, si el pivote puede ayudar

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Sí, esto funcionó. Gracias.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors