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

Notifications

Announcements

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
    153,079 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
    153,079 Most Valuable Professional on at
    You can add it wherever you want to collect the data - OnStart will work.
  • WarrenBelz Profile Picture
    153,079 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard