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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Cómo comparar el valor en dos tablas

Hola

:

He hecho dos tablas resumidas. Llamémoslos, Tabla1 y Tabla2.

En la tabla2, me gustaría añadir 4 nuevos colums.

El propósito de los nuevos colums es comparar fila por fila los siguientes campos: OpportunityID, Amount1, Amount2, Amount3

Por lo tanto, en la primera columna nueva, me gustaría comprobar si opportunityID en table1 - opportunityid en la tabla 2, si es así, sí de lo contrario no.

Para la segunda columna, me gustaría comprobar si la cantidad1 en la tabla 1 es la cantidad1 de la tabla2, si es así, sí, de lo contrario no. Lo mismo para column3 (comparar cantidad2) y column4 (comparar cantidad3).

¿Alguien sabe cómo hacer eso?

saludos

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hola @alepage ,

Por favor, intente utilizar la siguiente medida:

Measure =

IF (

    MAX ( Table1[Amount1] )

        = LOOKUPVALUE (

            Table2[Amount1],

            Table2[opportunityID], MIN ( Table1[opportunityID] )

        )

        && MAX ( Table1[Amount2] )

            = LOOKUPVALUE (

                Table2[Amount2],

                Table2[opportunityID], MIN ( Table1[opportunityID] )

            )

        && MAX ( Table1[Amount3] )

            = LOOKUPVALUE (

                Table2[Amount3],

                Table2[opportunityID], MIN ( Table1[opportunityID] )

            ),

    "yes",

    "no"

)

Saludos

Dedmon Dai

View solution in original post

1 REPLY 1
v-deddai1-msft
Community Support
Community Support

Hola @alepage ,

Por favor, intente utilizar la siguiente medida:

Measure =

IF (

    MAX ( Table1[Amount1] )

        = LOOKUPVALUE (

            Table2[Amount1],

            Table2[opportunityID], MIN ( Table1[opportunityID] )

        )

        && MAX ( Table1[Amount2] )

            = LOOKUPVALUE (

                Table2[Amount2],

                Table2[opportunityID], MIN ( Table1[opportunityID] )

            )

        && MAX ( Table1[Amount3] )

            = LOOKUPVALUE (

                Table2[Amount3],

                Table2[opportunityID], MIN ( Table1[opportunityID] )

            ),

    "yes",

    "no"

)

Saludos

Dedmon Dai

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors