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 / Help with calculating ...
Power Apps
Answered

Help with calculating average depending on varying denominator.

(0) ShareShare
ReportReport
Posted on by 90

I have the below objective assessment edit form, with 6 Objectives that need to be scored (0,3,5,7,10). ''Part B score'' field on top is the average of the invidual scores. I want the average calculated only for the objectives with content and score, as there may be varying number of objectives. In the below example,Part B score =  (3+5+5+3)/4. The denominator should change depending on number actual objectives 🤔. Please help me find a solution for this. Thank you.

ClipperSun_1-1628166098764.png

 

Categories:
  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @ClipperSun

     

    This takes an average of 3 control. Same applies for any number of controls

    Sum(Value(TextInput1.Text) + Value(TextInput1_1.Text) + Value(TextInput1_2.Text)) / Sum(
     If(
     !IsBlank(TextInput1.Text),
     1,
     0
     ),
     If(
     !IsBlank(TextInput1_1.Text),
     1,
     0
     ), If(
     !IsBlank(TextInput1_2.Text),
     1,
     0
     )
    )

     

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @ClipperSun 

     

    Works with 5 control. Use comma on the sum

     

    Sum(
     Value(TextInput1.Text),
     Value(TextInput1_1.Text),
     Value(TextInput1_2.Text),
     Value(TextInput1_3.Text),
     Value(TextInput1_4.Text)
    ) / Sum(
     If(
     !IsBlank(TextInput1.Text),
     1,
     0
     ),
     If(
     !IsBlank(TextInput1_1.Text),
     1,
     0
     ),
     If(
     !IsBlank(TextInput1_2.Text),
     1,
     0
     ),
     If(
     !IsBlank(TextInput1_3.Text),
     1,
     0
     ),
     If(
     !IsBlank(TextInput1_4.Text),
     1,
     0
     )
    )

     

     

    Sample:

    StalinPonnusamy_0-1628167702336.png

     

  • Verified answer
    ClipperSun Profile Picture
    90 on at

    Thank you. Worked!

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @StalinPonnusamy @ClipperSun 

    You might find the formula simplified to be more manageable and easier to alter:

    Average(
     Filter([TextInput1.Text, TextInput1_1.Text, TextInput1_2.Text, TextInput1_3.Text, TextInput1_4.Text], 
     !IsBlank(Value)
     ), Value(Value)
    )

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 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard