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 the Average ...
Power Apps
Unanswered

Calculate the Average of Data inputted into a form

(0) ShareShare
ReportReport
Posted on by

I am creating an app to help with data entry as I develop a product. At the moment it looks a lot like the default app created when you 'start from data'. I have it set up so that I can input all of the parameters used to create each iteration of the product into an excel file linked through onedrive. Next I would like to enter the results of the testing for each iteration, let call them 'time' and 'strength'. Depending on the iteration I may do one or more test, so I need to be able to add an indefinite amount of 'time' and 'strength' data to each iteration, and to calculate the average. What is the best way to accomplish this?

 

Thanks in Advance!

Categories:
  • MG-16101311-0 Profile Picture
    48 on at

    I am not sure where you are storing the data you are inputing from the form, but here's a thought:

     

    1) Initialize a collection on startup, something like:

    Clear(TestResults);

     

    2. You could store the data being captured in a collection, say when you click an "Insert" or "Submit" button, as follows:

    Collect(TestResults, {Time: SomeFormVariable.Value, Strength:SomeOtherFormVariable.Value});

     

    3. You can then have two label fields for the Average Time and Average Strength, with the following Text formula:

     

    Label1.Text = Average(TestResults, Time);

    Label2.Text = Average(TestResults, Strength);

     

    If this does not clarify anything for you, please feel free to add some screenshots and explain some of the controls you've added to your app and the mechanics surrounding some of it

     

     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @nickschwenger ,

    Do you want to calculate the data that you entered and update to data source?

    If so , I suggest you store the data that you entered as a collection, and then calculate the value in the collection.

    When you get the value that you want , update the whole collection to the data source.

    Could you give me an example of your calculation?

    I've made a similar test for your reference:

    1)

    ClearCollect(parameters,{id:1,par:TextInput1.Text},{id:2,par:TextInput2.Text},{id:3,par:TextInput3.Text},....)

    ///save paraments as a collection

    2)

    ClearCollect(results,{id:1,time:TextInput4.Text,strength:TextInput5.Text},
    {id:2,time:TextInput6.Text,strength:TextInput7.Text},.....)

    ///save results as a colletion

     

    3)

    time:
    
    ClearCollect(aaa,Average(ForAll(results,time*LookUp(parameters,id in results.id,par)),Value))
    
    strength:
    
    ClearCollect(aaa,Average(ForAll(results,strength+LookUp(parameters,id in results.id,par)),Value))

    //for example, time*paraments, strenth+paraments

    4)

    Patch(table, Defaults(table),{time:First(aaa).Value,strength:Firest(bbb).Value})

    update the average value

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard