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
EHa
Helper I
Helper I

Tablas de unión a la izquierda mediante Power Query / Medidas

Hola a todos, Lo siento por la simplicidad de la pregunta - Tuve un vistazo a través de algunas preguntas similares, pero no pude encontrar ninguna solución que me ayudó.

Entiendo que mis tablas no son de la configuración más fácil, pero necesitan permanecer en el formato actual para trabajar con el resto de mi informe.

Este es mi sencillo ejemplo:

Capture.PNG

En pocas palabras, me gustaría el nombre de la ciudad, en lugar del ID, cuando LevelOfDetail es Region.

No puedo simplemente vincular las dos tablas y usar region en lugar de attribute , como también me gustaría que la columna de atributo se mostrara para los otros valores levelofdetail. Mis dos primeros enfoques fueron 1) - crear una medida con una función if que utiliza la referencia para encontrar la ciudad cuando levelofdetail es ciudad, y acabamos de usar el atributo existente cuando no. 2) - escribir una combinación izquierda entre las dos tablas en la consulta de energía (estas dos tablas se importarán desde sql) y, a continuación, ordenar las tablas al formulario correcto mediante las barras de herramientas en la consulta de energía.

No pude ponerme a trabajar, así que si alguien tiene la soledad, eso sería muy apreciado.

Muchas gracias

Eha

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

hola @EHa

para su caso, le sugiero que cree una nueva columna de atributo en table2 por esta lógica:

New Attribute = 
VAR _ID=IF('Table 2'[LevelofDetail]="Region",VALUE('Table 2'[Attribute])) RETURN
IF('Table 2'[LevelofDetail]="Region",LOOKUPVALUE('Table 1'[City],'Table 1'[ID],_ID),'Table 2'[Attribute])

Ahora, cuando cree un objeto visual, utilice este nuevo atributo.

9.JPG

y aquí está el archivo pbix de muestra, por favor pruébelo.

saludos

Lin

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

hola @EHa

para su caso, le sugiero que cree una nueva columna de atributo en table2 por esta lógica:

New Attribute = 
VAR _ID=IF('Table 2'[LevelofDetail]="Region",VALUE('Table 2'[Attribute])) RETURN
IF('Table 2'[LevelofDetail]="Region",LOOKUPVALUE('Table 1'[City],'Table 1'[ID],_ID),'Table 2'[Attribute])

Ahora, cuando cree un objeto visual, utilice este nuevo atributo.

9.JPG

y aquí está el archivo pbix de muestra, por favor pruébelo.

saludos

Lin

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

Hola Lin,

Eso es genial, muchas gracias.

Apreciar el esfuerzo en rehacerlo también, muy claro ahora.

Salud

Eha

@v-lili6-msft

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.