Forum Discussion
Comparar columnas de tablas distintas
- Anonymous3 years ago
Hi alejandroezp ,
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.
Hi alejandroezp ,
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])
)
Please refer to the following document for more information.
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.
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
- Anonymous3 years agoNot applicable
Hi alejandroezp ,
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.