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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Compare values of 2 different tables

Hi,

 

I have 2 tables : 

Table 1

NameVersion 1Version 2
A112115
B112115
112115
112115
112115
112115
112115
H112115

 

Table 2: 

NameVersion
A112
B112
116
114
115
115

 

If in the same name, Table2[Version]  = Table1[Version1] OR Table2[Version]  = Table1[Version2]  ==> OK , if not KO

 

The result will be like this : 

 

NameVersionStatus
A112OK
B112OK
116KO
114KO
115OK
115OK

 

Thank you in advance for your help.

Tg

2 REPLIES 2
123abc
Community Champion
Community Champion

You can achieve this by creating a calculated column in Table 1 that checks whether the conditions in Table 2 are met. Here's how you can do it step by step:

Step 1: Add a Calculated Column in Table 1

Assuming your tables are named "Table1" and "Table2," add a calculated column in "Table1" using the following DAX formula:

 

Status = VAR CurrentName = Table1[Name] VAR CurrentVersion1 = Table1[Version 1] VAR CurrentVersion2 = Table1[Version 2] VAR MatchedVersions = FILTER( Table2, Table2[Name] = CurrentName && ( Table2[Version] = CurrentVersion1 || Table2[Version] = CurrentVersion2 ) ) RETURN IF(COUNTROWS(MatchedVersions) > 0, "OK", "KO")

 

This formula checks if there are any matching rows in Table2 for the current row in Table1 based on the Name, Version1, or Version2 columns.

Step 2: Create a Result Table

You can create a new table in Power BI to display the final result. Go to "Modeling" > "New Table" and use the following DAX formula:

 

ResultTable = SUMMARIZE(Table1, Table1[Name], Table1[Version], Table1[Status])

 

This formula summarizes the results from Table1, including the "Name," "Version," and "Status" columns.

Step 3: Visualize the Result

Now, you can create a visual using the "ResultTable" to display the "Name," "Version," and "Status." If "Status" is "OK," it means the conditions in Table 2 are met; otherwise, it's "KO."

Your visual will display the desired result with "OK" and "KO" statuses for each row in Table1 based on the conditions you specified.

Anonymous
Not applicable

@123abc 

Thank you for your solution. 

I would like to add the result directly to the Table 2 because I have many different tables to compare with table 1. 

Table 2 would be like this : 

NameVersionStatus
A112OK
B112OK
116KO
114KO
115OK
115OK

 

Regards,

Tg

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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