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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
bwang2
Helper I
Helper I

How to count mismatch of two columns in two tables?

I have one colum in a table for emplyee names (data base), and another table contains the same employes names (manual entry). I want to check if there was any mismatch between them. 

I was thinking using measure = Countrows(Filter(Table1,Table1[colum1]<>Table2[column2].

but Filter function only works in a single table. What should my approch be? Thanks  

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

Hi  @bwang2 ,

I created some data:

Table1:

vyangliumsft_0-1704864503679.png

Table2:

vyangliumsft_1-1704864503680.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
IF(
    MAX('Table1'[column1])=
LOOKUPVALUE(
    'Table2'[column2],'Table2'[employes names],MAX('Table1'[employes names])),"match","mismatch")

2. Result:

vyangliumsft_2-1704865084932.png

 

 

Best Regards,

Liu Yang

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

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @bwang2 ,

I created some data:

Table1:

vyangliumsft_0-1704864503679.png

Table2:

vyangliumsft_1-1704864503680.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
IF(
    MAX('Table1'[column1])=
LOOKUPVALUE(
    'Table2'[column2],'Table2'[employes names],MAX('Table1'[employes names])),"match","mismatch")

2. Result:

vyangliumsft_2-1704865084932.png

 

 

Best Regards,

Liu Yang

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

philouduv
Resolver III
Resolver III

Hello @bwang2 ,
An other approach could be to create a calculate column where you know the values are correct(Tablereference).

MisMatch = If(CALCULATE(COUNTROWS(Tabletocheck),FILTER(Tabletocheck,
Tablereference[name] == Tabletocheck[name])) > 0, "Match", "Not match")
tamerj1
Super User
Super User

Hi @bwang2 

please try

=
COUNTROWS ( EXCEPT ( VALUES ( Table1[colum1] ), VALUES ( Table2[column2] ) ) )

Thanks! is there a function I can use to display the mismatch as well?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.