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 / Calculate column in co...
Power Apps
Answered

Calculate column in collection

(0) ShareShare
ReportReport
Posted on by

I have an application where users will create a collection with several columns containing dates and times. At the end of the experience, I need to perform some calculations and fill in the remaining columns using the data collected. What formula can I use to go through the collection and perform calculations for each item and patch it to the correct column? 

For example, I have columns titled "Check", "Check Out", and "Difference". What formula would I use to get the difference between "Check" and "Check Out" in the "Difference" column for each item in the collection? 

Categories:
I have the same question (0)
  • Verified answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @CSilva 

     

    You can use addcolumns to do this:

    ClearCollect(
     NewCollection,
     AddColumns(
     YourCollection, // replace with your collection name
     "Difference",
     DateDiff(Check, CheckOut, TimeUnit.Minutes) // replace Minutes with Hours, Seconds, etc. as needed
     )
    )

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Let the user fill the collection without your calculated values. For example the user will collect startDate and endDate.

    They you can apply AddCollumns(yourcollection,"Mycalculation",DateDiff(startDate,endDate,days))

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard