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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
m14b
New Member

Comparar dos tablas con valores duplicados

Hola! soy nuevo en Power BI

 

Quisiera saber si hay alguna manera de poder comparar los datos de dos tablas, con una relacion de una columna en común, para saber que datos no se repiten en una de las tablas.

 

Me explico:

 

Tengo dos tablas, una tiene toda la informacion de todas las ventas por producto y cliente

 

EJEMPLO:

 

NOMBRECODIGOARTICULOCANTIDADFECHA
JUAN PEREZJBN20JABON9422-01-2024
JUAN PEREZSPU98SHAMPOO5623-01-2024

JUAN PEREZ

DNT65DESODORANTE3208-03-2024
JUAN PEREZCMA73CREMA FACIAL4210-03-2024

...

 

Y la otra tiene el catalogo de todos los productos existentes:

 

CODIGOARTICULO
JBN20JABON
SPU98SHAMPOO
DNT65DESODORANTE
CMA73CREMA FACIAL
PFM58PERFUME
MRA55MASCARILLA

...

 

Hasta ahora con excel comparaba las dos tablas poniendoles un formato condicional para que resaltara los valores unicos de la tabla 2 

 

m14b_0-1719335379169.png

 

m14b_1-1719335428448.png

 

De esta manera obtenia que productos no habia comprado cierto cliente, (ej. Daniela no compró shampoo, desodorante ni mascarillas) y tambien podia filtrarlo por mes con la tabla dinamica.

 

Sin embargo el catalogo de productos es extenso y ocupa muchas filas, por lo que hacer esto no es tan practico.

 

Mi pregunta es, ¿hay alguna manera de hacer esto en PowerBI?, es decir obtener los productos que un cliente no ha comprado filtrando por cliente, y por mes, mediante una relacion de las dos tablas con la informacion.

 

Gracias por la ayuda

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @m14b 

You can refer to the following solution.

Sample data

Customer_sales table

vxinruzhumsft_0-1719365934094.png

Product table

vxinruzhumsft_1-1719365948290.png

Calendar table

vxinruzhumsft_3-1719365969462.png

there is no relationship between product and customer table, there is a 1:N relationshop between customer and calendar table.

vxinruzhumsft_4-1719366096506.png

 

Create a measure

Except_product =
VAR a =
    VALUES ( 'Customer_sales'[Product] )
VAR b =
    VALUES ( 'Product'[Product] )
RETURN
    COUNTROWS ( EXCEPT ( b, a ) )

Create a table visual and put the product column of product table and the measure to the visual.

vxinruzhumsft_6-1719366259566.png

 

Output

vxinruzhumsft_8-1719366340284.png

Best Regards!

Yolo Zhu

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
Anonymous
Not applicable

Hi @m14b 

You can refer to the following solution.

Sample data

Customer_sales table

vxinruzhumsft_0-1719365934094.png

Product table

vxinruzhumsft_1-1719365948290.png

Calendar table

vxinruzhumsft_3-1719365969462.png

there is no relationship between product and customer table, there is a 1:N relationshop between customer and calendar table.

vxinruzhumsft_4-1719366096506.png

 

Create a measure

Except_product =
VAR a =
    VALUES ( 'Customer_sales'[Product] )
VAR b =
    VALUES ( 'Product'[Product] )
RETURN
    COUNTROWS ( EXCEPT ( b, a ) )

Create a table visual and put the product column of product table and the measure to the visual.

vxinruzhumsft_6-1719366259566.png

 

Output

vxinruzhumsft_8-1719366340284.png

Best Regards!

Yolo Zhu

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

Thank you so much, it was just what i needed

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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