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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jacob2102
Helper II
Helper II

Dividir consulta en dos variables

Hola,

 

He agregado una consulta en PowerQuery con origen en Excel. Tras hacer diferentes transformaciones, para poder tratarla apropiadamente con PowerBI, obtengo una columna con dos variables (m2 e importe) y otra variable valor para cada una de las filas.

 

A partir de esta situación, me gustaría tener una columna para m2 con sus valores y otra con los importes.

 

La situación es la siguiente:

PAÍSVARIABLEVALOR
Españam210
Españaimporte100

 

Y me gustaría obtener algo similar a esto:

PAISm2importe
España10100

 

Tras hacer diferentes pruebas, he generado una variables única de código único concatenando el resto de columnas. Luego he duplicado la consulta, para en cada una dejar sólo m2 o importe, y finalmente he combinado ambas consultas para poder obtener el restultado final.

 

¿Hay alguna opción de obtener este resultado aplicando menos pasos? He probado con diferentes opciones de transformación (eliminar dinamización de consultas) pero nunca obtengo los resultados esperados.

 

Gracias. Un saludo,

Jacob

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @jacob2102 ,

 

Try to us pivot. Select the VARIABLE column, then click Pivot Column, then set as shown in the figure below, click OK

10.png

11.png

 

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @jacob2102 ,

 

Try to us pivot. Select the VARIABLE column, then click Pivot Column, then set as shown in the figure below, click OK

10.png

11.png

 

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks so much @v-stephen-msft ,

This action is perfect.

 

Best regards,

Jacob

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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