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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
hillandmichael
Regular Visitor

Power Query, comparing two tables, show changes

Hi, 

 

I have two tables and I want to show any changes in table two from table one. For example:

 

Data change step.PNG

 

1. The stroke can have more than one row of data 

2. Table 2, not all strokes will have made a change of hanger reference

3. Table 2, new stroke references can be seen (though these should be excluded. 

 

How do I get a table that matches the result table?

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

One approach would be to start with Table 2, merge in Table 1 matching on Stroke, expand the Table 1 reference column, and then filter the resulting table with the rule [New Reference] <> [Previous Reference]. Note: this would give 123125 twice in the final table instead of having a blank cell.

View solution in original post

5 REPLIES 5
wdx223_Daniel
Community Champion
Community Champion

=let a=Table.Buffer(Table.Group(Table1,"Stroke",{"t",each [Hanger Reference]})) in #table({"Stroke","New Reference","Previous Reference"},List.TransformMany(Table.ToRows(Table.Group(Table2,"Stroke",{"t",each [Hanger Reference]})),each let r1=a{[Stroke=_{0}]}?[t]? ??{} in if List.ContainsAll(r1,_{1}) then {} else List.Zip({List.RemoveItems(_{1},r1),List.RemoveItems(r1,_{1})}),(x,y)=>{x{0}}&y))

Thanks Daniel. will I add this as a query? 

just copy this code in your new step

Sorry i am not following. Where would I add the code? Will this be a new measure or a new column? 

AlexisOlson
Super User
Super User

One approach would be to start with Table 2, merge in Table 1 matching on Stroke, expand the Table 1 reference column, and then filter the resulting table with the rule [New Reference] <> [Previous Reference]. Note: this would give 123125 twice in the final table instead of having a blank cell.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.