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 Average Base...
Power Apps
Answered

Calculate Average Based On Selection Of DropDownList

(0) ShareShare
ReportReport
Posted on by 73
If(Dropdown2.Selected.Value = "Calculate two", (TextInput11.Text=Text(Average(Value(TextInput9.Text),Value(TextInput10.Text)))));

 

I want to calculate the average based on selection on dropdownlist, but it seem not working and I can't find out what's wrong with my code. 

Is that any better solution for this? Thanks.

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @NeohLooi 

    Is TextInput11 the control where you want the Average to appear? If so, you don't need to reference it so remove that part of your formula ie

     

    If( Dropdown2.Selected.Value = "Calculate two", Text( Average(...) ) )

  • Verified answer
    timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @NeohLooi 

    The issue is that it is not possible to make assignments in the way that you're attempting. For example, we cannot use the syntax TextInput11.Text= to assign a value to the TextInput11 control.

    If you were to set the text property of TextInput11 to the following formula, that should hopefully take you further.

     

     

    If(Dropdown2.Selected.Value = "Calculate two", 
     Text(Average(Value(TextInput9.Text),
     Value(TextInput10.Text)
     )
     )
    )
    

     

     

  • NeohLooi Profile Picture
    73 on at

    I want it trigger on button , is that anyway to do it?

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    Hi @NeohLooi 

    Set the OnSelect property of your button to:

     

    Set(varAverage,
    If(Dropdown2.Selected.Value = "Calculate two", 
     Text(Average(Value(TextInput9.Text),
     Value(TextInput10.Text)
     )
     )
    )
    )

     You can then set the Text property of your text input control to varAverage.

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard