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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
hnguyen76
Resolver II
Resolver II

PowerQuery Unpivot filas superiores

Buenos días

Esperemos que esta es una solución fácil de arreglar, pero no puedo envolver mi cabeza alrededor de ella. Tengo un archivo fuente que me da datos en este formato:

Columna1Columna2Columna3Columna4Columna5
2019202020202020
12010203
ID2031000101010151020
ID205500550600650

La primera fila tiene mi año y la segunda fila tiene mis meses. Quiero des- dinámicamente despivotar los datos para que puedan verse así:

Columna1Columna2Columna3Columna4
ID2032019121000
ID2032020011010
ID2032020021015
ID2032020031020
ID205201912500
ID205202001550
ID205202002600
ID205202003650


Perforo agregando una columna calculada y usando la investigación, pero no parece darme los resultados correctos. Cualquier ayuda sería muy apreciada!

1 ACCEPTED SOLUTION

Hola @hnguyen76 ,

Mira esto.

PBIX

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

4 REPLIES 4

Hola @hnguyen76 ,

1. Transponer tabla

20200409_01.png

2. Sustituya los valores por nombres de encabezado

20200409_02.png

3. Utilice la primera fila como encabezado

20200409_03.png

4. Marque las columnas ID y Unpivot Columns

20200409_04.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hola @mwegener ,

Acabo de probarlo con el ejemplo de ejemplo y parece estar funcionando. Mi conjunto de datos tiene una columna y fila más que el ejemplo de ejemplo.

Necesito transformar esto:

Columna1Columna2Columna3Columna4Columna5Columna6
2019202020202020
12123
YTDPeríodoPeríodoPeríodo
ID203Tecnología1000101010151020
ID205Tecnología500550600650
ID203Sam2000201020152040
ID205Sam100011001200

1300


En esto:

añoMesTipoClaveNivel1Valor
201912YTDID203Tecnología1000
201912YTDID205Tecnología500
201912YTDID203Sam2000
201912YTDID205Sam1000
20201PeríodoID203Tecnología1010
20201PeríodoID205Tecnología550
20201PeríodoID203Sam2010
20201PeríodoID205Sam1100
20202PeríodoID203Tecnología1015
20202PeríodoID205Tecnología600
20202PeríodoID203Tecnología2015
20202PeríodoID205Tecnología1200
20203PeríodoID203Sam1020
20203PeríodoID205Sam650
20203PeríodoID203Sam2040
20203PeríodoID205Sam1300

No puedo hacer que funcione, ya que este es el resultado que estoy obteniendo de tus pasos:

añoMesPeríodoAtributoValor
ID203Tecnología
ID205Tecnología
ID203_1Sam
ID205_2Sam
201912YTDID2031000
201912YTDID205500
201912YTDID203_12000
201912YTDID205_21000
20201PeríodoID2031010
20201PeríodoID205550
20201PeríodoID203_12010
20201PeríodoID205_21100
20202PeríodoID2031015
20202PeríodoID205600
20202PeríodoID203_12015
20202PeríodoID205_21200
20203PeríodoID2031020
20203PeríodoID205650
20203PeríodoID203_12040
20203PeríodoID205_21300

Hola @hnguyen76 ,

Mira esto.

PBIX

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Maldita sea. Había hecho esto antes. Olvidé lo desanimado. ¡Gracias @mwegener funcionó! ¡Enviándote abrazos virtuales!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors