Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Tengo dos tablas: "Datos" e "Informe".
La tabla "Datos" consta de columnas como tipo, identificador, código y país.
Mientras tanto, la tabla "Informe" incluye columnas denominadas Elemento, tipo, código y país.
La conexión entre estas tablas se establece a través de las columnas type, id y code.
Mi objetivo es extraer el id de la tabla "Datos" e incorporarlo a la tabla "Informe", utilizando los criterios de tipo de coincidencia, código y país.
Tabla de informes:
| Artículo | Tipo | Código | País | Resultado deseado |
| 123 | EL1 | 0070 | 077 | |
| 124 | EL1 | 1000 | 077 | |
| 125 | EL1 | 0070 | 077 | |
| 126 | EL1 | 1000 | 077 | |
| 127 | A07 | 0600 | QUIÉN | |
| 128 | A07 | 0930 | QUIÉN | |
| 129 | A07 | 0600 | QUIÉN | |
| 130 | A07 | 0930 | QUIÉN | |
| 131 | A08 | 0840 | Reino Unido | GT |
| 132 | A08 | 0840 | NOS | LUK |
| 133 | A08 | 0840 | EURO | RR |
| 134 | A08 | 0840 | ||
| 135 | AA1 | 0260 | Reino Unido | RR |
| 136 | AA1 | NOS | QUIÉN | |
| 137 | AA1 | EURO | GT | |
| 138 | AA1 | PELOTA | LUK | |
| 139 | AA1 | ENTONCES | SL1 | |
| 140 | AA1 | EN | SL2 | |
| 141 | AA1 | ESO | SL3 | |
| 142 | AA1 | ENLATAR | SL4 | |
| 143 | AA1 | DE | SL5 |
Datos:
| Tipo | Identificación | Código | País |
| A02 | LPG | 0140 | |
| EL1 | 077 | 0070 | |
| EL1 | 077 | 1000 | |
| A01 | RBI | 0160 | |
| A06 | A01 | 0490 | |
| A06 | A02 | 0990 | |
| A07 | QUIÉN | 0600 | |
| A07 | QUIÉN | 0930 | |
| A08 | SSR | 0840 | |
| A08 | DEL | 1050 | |
| A08 | MI | 0840 | |
| A08 | GT | 0840 | Reino Unido |
| A08 | LUK | 0840 | NOS |
| A08 | RR | 0840 | EURO |
| A08 | RCB | 0610 | |
| A08 | KKR | 0200 | |
| A08 | XPHJ | ||
| AV1 | X01 | 1160 | |
| AA1 | RR | 0260 | Reino Unido |
| AA1 | QUIÉN | NOS | |
| AA1 | GT | EURO | |
| AA1 | LUK | PELOTA | |
| AA1 | SL1 | ENTONCES | |
| AA1 | SL2 | EN | |
| AA1 | SL3 | ESO | |
| AA1 | SL4 | ENLATAR | |
| AA1 | SL5 | DE |
Hola
Escriba esta fórmula de columna calculada en la tabla Informe
Column = CALCULATE(MAX(Data[Id]),FILTER(Data,Data[Type]=EARLIER(Report[Type])&&Data[Code]=EARLIER(Report[Code])&&Data[Country]=EARLIER(Report[Country])))
Espero que esto ayude.
¿Es necesario que sea DAX o puede estar en Power Query?
@lbendlin, gracias por tu respuesta. Si es posible proporcionar la solución en ambos sentidos (nueva columna de cálculo de DAX y consulta de energía), ayudará a comprender Power BI.
Informe de la tabla:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fdDLDoMgEAXQXzGsXQwPQZfUmrYpMY2PTY3//xsyA8WgqQtHkuPNHVkWxoVkJbNf7ieAAf8q8GgMW0tklZgDnLm6TuvrtEEGnKATt88ucr1zI8/cXKYp8D8tOTFWQK2Q57cfjymyOPHoh/MfBZdH7+bBz2GIro5e0BOQbs3SrQmdulNWJy5+xfveJsPQmrauM7xZl+3cZPqxWDo6HpSW3PXV30lFVJ7rRCgjigxb25OqqDJTS/8zuoqt6wY=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Type = _t, Code = _t, Country = _t, #"Desired Result" = _t]),
#"Merged Queries" = Table.NestedJoin(Source, {"Type", "Code", "Country"}, Data, {"Type", "Code", "Country"}, "Data", JoinKind.LeftOuter),
#"Expanded Data" = Table.ExpandTableColumn(#"Merged Queries", "Data", {"Id"}, {"Id"})
in
#"Expanded Data"
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.