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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
learning2022
New Member

Comparing data in two tables with different columns

Hi

 

I am trying to compare data in two tables with the following scenarios. 

 

Scenario 1 

 

Same number of columns and match the data. Results should highlight the differences in the data.

 

Scenario 2

 

Different number of columns and match the data.  Results should highlight the differences in the data.

 

Currently, I am using the following query, however, the issue is that I have to create comparisons (through measures) for each column.  Is it possible to simplify this formula so that it can cover the entire table in one go?

GoalTypeMatch = 
var _cloupra_goals_type = SELECTEDVALUE(Cloupra_Goal[cloupra__Type__c])
var _practifi_goals_type = SELECTEDVALUE(practifi__Goal__c[practifi__Type__c])
return
if (_cloupra_goals_type=_practifi_goals_type,"Match", "No Match")

Thanks

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @learning2022 ,

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

 

Best Regards,
Community Support Team _ kalyj

rbriga
Impactful Individual
Impactful Individual

Assuming the columns have the same name:

  1. In the query editor, add a manual "source" column.
    1. The value will be [Table 1 name] and [Table 2 name]
  2. Union these 2 tables ("Append Queries" in the query editor).
  3. Create a matrix on the new, appended table.
    1. Each coulumn in the table will go into the matrix values as distinct count
    2. "Source" will go into the matrix columns
  4. If the tables are the same, "distinct count" of any column will show Table1 = Table2 = Total
  5. You can expend on that by adding ID fields to find the difference if needed.
-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.