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
ItsmeFelix
Frequent Visitor

Compare what changed in two lists

Hi, 

I have two tables with IDs and another entry (lets say fruist) which I want to compare

(My real tables have thousands of rows with 7 different fruits)

e.g. Table1:

IDFruit
1apple
2apple
3banana
6orange
8banana

e.g. Table2:

IDFruit
1apple
2apple
3banana
4apple
8orange

 

I want to track if IDs got added (like ID = 4), removed  (like ID = 6) or changed  (like ID = 8 )

At the moment I have a solution that compared the IDs and can tell me if an ID got added or removed but not changed:

----------------------------------------------------------------------------------------------------------

let
removed = List.Difference(Table1[ID], Table2[ID]),
removed_com= Table.AddColumn(Table.FromList(removed),"Change", each "removed"),
added = List.Difference(Table2[ID], Table1[ID]),
added_com = Table.AddColumn(Table.FromList(added),"Change", each "added"),

my_changes = Table.Combine({added_com,removed_com})
in
my_changes

----------------------------------------------------------------------------------------------------------

I would like to see the changes too, is this possible and how?

(It would also be nice if it is possible to get the fruit for the changing IDs)

 

1 ACCEPTED SOLUTION
spinfuzer
Super User
Super User

Just do a Full Outer Join and then if then statements comparing your left table to your right table values and where it is null and not null.

 

if [ID] = [Table2.ID] and [Fruit] = [Table2.Fruit] then...

else if [ID] = null then ...

 

etc...

 

View solution in original post

2 REPLIES 2
ItsmeFelix
Frequent Visitor

This worked, thank you!

 

spinfuzer
Super User
Super User

Just do a Full Outer Join and then if then statements comparing your left table to your right table values and where it is null and not null.

 

if [ID] = [Table2.ID] and [Fruit] = [Table2.Fruit] then...

else if [ID] = null then ...

 

etc...

 

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.