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
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
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.

Top Solution Authors