cancel
Showing results 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.

Frequent Visitor

## Comparar columnas de tablas distintas

Buenos días,

Tengo dos tablas con dos columnas cada una. Quiero sacar las filas que no coinciden entre ambas columnas, el problema es que entre todas las columnas pueden coincidir y ser de verdad únicas. Para arreglar este posible fallo, creo una tercera columna y concateno las otras dos columnas de cada tabla. En este punto quiero comparar las dos columnas concatenadas (Una de cada tabla), de tal forma que me muestre las que no coinciden y así ver las que no aparecen.

Saludos

1 ACCEPTED SOLUTION
Community Support

I'm sorry if I misunderstood you, but if you want to know the number of rows, please change the measure to:

``````NonMatching_rows =
COUNTROWS(
EXCEPT(
SELECTCOLUMNS(Table1, "ConcatenatedColumn1", Table1[ConcatenatedColumn1]),
SELECTCOLUMNS(Table2, "ConcatenatedColumn2", Table2[ConcatenatedColumn2])
)
)``````

Best Regards,

Neeko Tang

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

3 REPLIES 3
Community Support

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

Table1:

Table2:

(2) Create series columns in Tables 1 and 2, respectively.

``ConcatenatedColumn1 = CONCATENATE(Table1[Column1], Table1[Column2])``
``ConcatenatedColumn2 = CONCATENATE(Table2[Column1], Table2[Column2])``

(3)We  can create a table.

``````NonMatching =
EXCEPT(
SELECTCOLUMNS(Table1, "ConcatenatedColumn1", Table1[ConcatenatedColumn1]),
SELECTCOLUMNS(Table2, "ConcatenatedColumn2", Table2[ConcatenatedColumn2])
)``````

EXCEPT function (DAX) - DAX | Microsoft Learn

(4) Then the result is as follows.

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards,

Neeko Tang

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

Frequent Visitor

Buenos días,

He probado la solución y no me ha funcionado. Adjunto algunos datos y especifico mejor el proceso:

En las tablas concatenamos las columnas "Company" y "Name", después comparamos el resultado de concatenar la tabla1 y la tabla2. Al comparar el resultado de concatenar la tabla1 y la tabla2 quiero sacar el número de filas que no coinciden, es decir, las filas concatenadas que ,buscando desde la tabla1 en la tabla2, no aparecen en la tabla2 y que me indique el número de filas.

Tabla1:

 Company Category Type Item Name ONO ESPAÑA CLIENTES HARDWARE INFRAESTRUCTURA SONDA KP113 R59199 - CELTA, S.A. HARDWARE EQUIPAMIENTO VOZ TERMINAL FIJO XP152 R2803408 - ORDENADORES MANOLO, S.A. HARDWARE PERIFERICOS OTROS (PERIFERICOS) VISTA345 T417101I - UCM HARDWARE ACCESORIOS ADAPTADOR UX83491 R4545903 - SANTANDER, S.A. HARDWARE EQUIPAMIENTO VOZ TARJETA VOZ ux09133 R3033515 - ALBACET Y ASOCIADOS S.A. HARDWARE PERIFERICOS MONITOR QW7321 Q82007A - IKEA HARDWARE EQUIPAMIENTO VOZ TERMINAL FIJO I8329 R2803408 - ORDENADORES MANOLO, S.A. HARDWARE PERIFERICOS OTROS (PERIFERICOS) K8341

Tabla2:

 CLASSID COMPANY NAME SHORTDESCRIPTION EQUIPMENT ONO ESPAÑA CLIENTES ZV7728 MICRO EQUIPMENT ONO ESPAÑA CLIENTES KP113 DISCO DURO EQUIPMENT T417101I - UCM UX83491 PANTALLA EQUIPMENT R2803408 - ORDENADORES MANOLO, S.A. BV5591 CD EQUIPMENT R4545903 - SANTANDER, S.A. ux09133 PC EQUIPMENT R59199 - CELTA, S.A. YW2189 PANTALLA EQUIPMENT R2803408 - ORDENADORES MANOLO, S.A. MC2044 PANTALLA EQUIPMENT R2803408 - ORDENADORES MANOLO, S.A. K8341 DISCO DURO

Saludos

Community Support

I'm sorry if I misunderstood you, but if you want to know the number of rows, please change the measure to:

``````NonMatching_rows =
COUNTROWS(
EXCEPT(
SELECTCOLUMNS(Table1, "ConcatenatedColumn1", Table1[ConcatenatedColumn1]),
SELECTCOLUMNS(Table2, "ConcatenatedColumn2", Table2[ConcatenatedColumn2])
)
)``````

Best Regards,

Neeko Tang

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

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors