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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gauravnarchal
Post Prodigy
Post Prodigy

Columnas coincidentes en 2 tablas

Tengo dos tablas como se muestra a continuación. Quiero validar y hacer coincidir los valores de la columna Producto de la tabla 1 con la columna Producto de la Tabla 2, de lo contrario, debería devolver "Valor incorrecto".

En lugar de crear una tabla de búsqueda, ¿se puede hacer a través de la medida? Pls sugieren la mejor opción.

Tabla 1

ID de referenciaProductoCategoría
2349898729WwY
2449898728WwY
2549898727WwO
2649898726WwO
2749898725KkY
2849898724KkY
2949898723KkY
3049898722KkY
3149898721KkW
3249898720WwE
3349898719WwE
3449898718TtR
3549898717TtR
3649898716TtR
3749898715TtR
3849898714PpM
3949898713PpM
4049898712LkN

Tabla 2

ProductoCategoría
WwY
WwO
KkY
TtR
PpM
PpN

Cómo se debe mostrar el resultado

ID de referenciaProductoCategoríaResultado
2349898729WwYVálido
2449898728WwYVálido
2549898727WwOVálido
2649898726WwOVálido
2749898725KkYVálido
2849898724KkYVálido
2949898723KkYVálido
3049898722KkYVálido
3149898721KkWVálido
3249898720WwEVálido
3349898719WwEVálido
3449898718TtRVálido
3549898717TtRVálido
3649898716TtRVálido
3749898715TtRVálido
3849898714PpMVálido
3949898713PpMVálido
4049898712LkNValor incorrecto

2 ACCEPTED SOLUTIONS
AllisonKennedy
Super User
Super User

¿Hay alguna relación entre las tablas? Si no, puedes usar algo como:

IF( SELECTEDVALUE(Table1[Producto]) EN VALUES(Table2[Producto]), "valid", Incorrecto")

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

SteveCampbell
Memorable Member
Memorable Member

Puedes intentarlo

Measure = 
var _sv = RIGHT(SELECTEDVALUE(Table1[Ref ID]),2)
VAR _LU = Calculate( FIRSTNONBLANK(  Table 2[Category],0 ) , Table 2[Product] = _sv )
var _CV = Table1(ProductCategory)

RETURN

IF ( _LU = _SV, "Valid", "Incorrect Value" )





Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



View solution in original post

2 REPLIES 2
SteveCampbell
Memorable Member
Memorable Member

Puedes intentarlo

Measure = 
var _sv = RIGHT(SELECTEDVALUE(Table1[Ref ID]),2)
VAR _LU = Calculate( FIRSTNONBLANK(  Table 2[Category],0 ) , Table 2[Product] = _sv )
var _CV = Table1(ProductCategory)

RETURN

IF ( _LU = _SV, "Valid", "Incorrect Value" )





Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



AllisonKennedy
Super User
Super User

¿Hay alguna relación entre las tablas? Si no, puedes usar algo como:

IF( SELECTEDVALUE(Table1[Producto]) EN VALUES(Table2[Producto]), "valid", Incorrecto")

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.