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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Compare two tables and display missing rows from the first table in a dynamic fashion

Hi Folks,

I am a novice in power BI. I have two different tables that have hundreds of rows in them. The first table has live data i.e data changes every few seconds. The data in the second table changes once a day. These two tables are connected by a common column(Name). I want to compare two tables on the column 'name' and then display the rows of table-1 which are not present in Table-2. This comparison needs to be done dynamically(Since the Table-1 has live data). Can anyone help me how to do this:
My data looks like this

 

TABLE - 1

   Name      Occupation     Address     Age

JohnArtistHouston40
AdamTeacherDallas42
NikkyDriverArlington35
RoyEngineerAustin33
MillerWaiterDallas41
KierenBusinessmanPalo29
MorkelAthleteAlto44
WarnerCoachSan Jose22
BairstowAdministratorCleveland66

  

TABLE - 2

Name   Marital Status     Phone

AdamMarried2341232345
RoySingle7781231223
MillerMArried4561947563
MorkelSingle3864977155

 

DESIRED OUTPUT

Name          Occupation     Address    Age

JohnArtistHouston40
NikkyDriverArlington35
KierenBusinessmanPalo29
WarnerCoachSan Jose22
BairstowAdministratorCleveland66
2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

Create a measure to check if the records exist in Table 2

ExistInTable2 =  CONTAINS('TABLE - 2','TABLE - 2'[Name],MAX('TABLE - 1'[Name])) * 1

Add the above measure to the Visual Filter of Table 1 and set to  = 0 and click apply. It will update automatically 

 

Fowmy_0-1601370024072.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

PaulDBrown
Community Champion
Community Champion

@Anonymous 

One way is to create a measure to use in the filter pane:

Names Exclusive To table 1 = 
VAR Tab1 = VALUES(Table1[Name])
VAR TAb2 = VALUES(Table2[Name])
RETURN
COUNTROWS(EXCEPT(Tab1, TAb2))

Add this measure to "Filters for this visual"  in the filter pane and set the value to 1

 

Exclusive Names.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

@Anonymous 

One way is to create a measure to use in the filter pane:

Names Exclusive To table 1 = 
VAR Tab1 = VALUES(Table1[Name])
VAR TAb2 = VALUES(Table2[Name])
RETURN
COUNTROWS(EXCEPT(Tab1, TAb2))

Add this measure to "Filters for this visual"  in the filter pane and set the value to 1

 

Exclusive Names.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Dear @PaulDBrown many tnx for this solution! I found it really usefull for me!!!

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please let us know whether @Fowmy 's method is helpful.

 

If it is, please accept his reply as solution to your question so that people who may have the same question can get the solution directly.

 

If not, please give us more details.

 

 

Best Regards,

Icey

Fowmy
Super User
Super User

@Anonymous 

Create a measure to check if the records exist in Table 2

ExistInTable2 =  CONTAINS('TABLE - 2','TABLE - 2'[Name],MAX('TABLE - 1'[Name])) * 1

Add the above measure to the Visual Filter of Table 1 and set to  = 0 and click apply. It will update automatically 

 

Fowmy_0-1601370024072.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , Please find the attached file after the signature. the new table is create.

 

Measure like this

Measure = var _new = EXCEPT(ALL(Table1[Name]),all(Table2[Name])) return if( max(Table1[Name]) in _new,1,blank())

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak,

The table you have created is working well when the data is stable in two tables. The measure, you have created displays the value 1. As the data in table-1 changes every few seconds, the table you have created is not considering the new rows that are being updated. We have to continuously compare the two tables and update the new table continuously. Do you have any kind of solution to this problem?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.