web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to compare two tab...
Power Apps
Answered

How to compare two tables and look for differences?

(0) ShareShare
ReportReport
Posted on by 2
I have two tables with the same columns. Lets say it is 'ID', 'Name', 'Quantity' and 'Date'. The information under the columns Quantity and Date can change and therefore the tables can differ (Not ID or Name). I want to create an app which with a button or on start up compares the tables and present the differences. How do i make the comparison?
 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,137 Most Valuable Professional on at
    This should produce a Collection with any different fields and the different values
    ForAll(
       Table1 As _T1,
       With(
          {
             _Data: 
             LookUp(
                Table2,
                ID = _T1.ID
             )
          },
          If(
             _Data.Quantity <> _T1.Quantity || _Data.Date <> _T1.Date,
             Collect(
                colDiff,
                {
                   ID: _T1.ID,
                   Name: _T1.Name,
                   Quantity: _T1.Quantity,
                   Quantity2: _Data.Quantity,
                   Date: _T1.Date,
                   Date2: _Data.Date
                }
             )
          )
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
  • KN-18111252-0 Profile Picture
    2 on at
    Do i add this code under 'OnStart' property of the app? Sorry i am new to Power Apps,
  • WarrenBelz Profile Picture
    156,137 Most Valuable Professional on at
    You can add it wherever you want to collect the data - OnStart will work.
  • WarrenBelz Profile Picture
    156,137 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard