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

Compare two excel sheet and calculate how many rows are matching

Hi

 

I have 2 excel sources and data is as below. I want to check for each combination of App and Columns in Excel 1 matches with the combination in Excel 2 and come up with a table which show how many combinations are aligned.  

In this e.g. App A1 has 3 columns and they match with the 3 columns in Excel 2. But for App A2, C4 has a match but C5 doesnt have one. So App A1 is aligned 100%, 3 out of 3 are matching and A2 should be 50% as 1 out 2 match.

Please suggest how this can be accomplished? Thanks.

 

Excel 1  Excel 2
AppColumns  AppColumns
A1C1  A1C1
A1C2  A1C2
A1C3  A1C3
A2C4  A2C4
A2C5  A2C6

 

App% of Columns Aligned?
A1100
A250
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like, But for this need to have a common  table with column app, joined to both tables

 

a measure like

countrows(Table1, [app], [column]) - countrows( except(summarize(Table1,[app], [column]), summarize(Table2,[app], [column]) ))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @amitchandak - the solution worked fine, now got slightly different requirement. There can be Apps with '_Test', but this wont be available in excel 2. In this case we have to compare A1_Test with A1 and show as 100%. 

I tried to add a new column, trimmed '_Test' part and tried to check with entries in Excel 2. But it is not working as expected, it is considering A1_Test and A1 as A1. Need to display A1 and A1_Test as seperate entries in output. Any suggestions will be highly appreciated.

Thanks.

 

Excel 1  Excel 2  
AppColumns  AppColumns
A1C1  A1C1
A1C2  A1C2
A1C3  A1C3
A2C4  A2C4
A2C5  A2C6
A1_TestC1    
A1_TestC2    
A1_TestC3    

 

Expected Output

App% of Columns Aligned?
A1100
A250
A1_Test100

 

amitchandak
Super User
Super User

@Anonymous , Try a measure like, But for this need to have a common  table with column app, joined to both tables

 

a measure like

countrows(Table1, [app], [column]) - countrows( except(summarize(Table1,[app], [column]), summarize(Table2,[app], [column]) ))

Anonymous
Not applicable

Thank you @amitchandak. This helps.

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.