Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
Anonymous
Not applicable

How to compare value in two tables

Hello,

I have made two summarized table.  Let's call them, Table1 and Table2.

In table2, I would like to add 4 new colums.

 

The purpose of the new colums is to compare row by row the following fields: OpportunityID, Amount1, Amount2, Amount3

So in the first new column, I would like to check if opportunityID in table1 =  opportunityid in table 2, if so, yes otherwise no.

For the second column, I would like to check if amount1 in table 1 = amount1 in table2, if so yes, otherwise no.  Same thing for column3 (compare amount2) and column4(compare amount3).

 

Does someone know how to do that?

Regards,

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

Hi @Anonymous ,

 

Would you please try to use the following measure:

 

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"

)

 

Best Regards,

Dedmon Dai

View solution in original post

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

Hi @Anonymous ,

 

Would you please try to use the following measure:

 

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"

)

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

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.