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 / Displaying an Average ...
Power Apps
Answered

Displaying an Average of Data from a SharePoint List

(0) ShareShare
ReportReport
Posted on by 84

Hi there,

 

I have built the following chart which is control via a DROPDOWN menu.

LaingBennett_0-1603289559226.png

The data table that this comes from looks like this. 

LaingBennett_1-1603289625379.png

What I want to do is get an average amount of the number of events. This would be a sum of the Total divide by the number of Years in the selected list. 

 

I am using the following to try and get the total but it does not return a number.

Text(Sum(Filter('2020 - Sale Historical Data by Year' , Event = Historic_Data_DD.Selected.Value)

Also, I don't know where to begin to get it to divide by the count of rows. 

 

Thanks

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

    @LaingBennett 

     

    Consider the following formula to resolve your average:

    With({theData: Filter('2020 - Sale Historical Data by Year' , Event = Historic_Data_DD.Selected.Value)},
    
     Text(
     Sum(theData, Total) / CountRows(theData)
     )
    )
     

     

    I hope this is helpful for you.

  • LaingBennett Profile Picture
    84 on at

    Thank you very much - works perfectly. 

  • LaingBennett Profile Picture
    84 on at

    Sorry I forgot to mention how to you get the return value to round to a whole number? Currently it have 8 decimal places. 

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

    @LaingBennett 

    Use a format on your Text function:

    With({theData: Filter('2020 - Sale Historical Data by Year' , Event = Historic_Data_DD.Selected.Value)},
    
     Text(
     Sum(theData, Total) / CountRows(theData),
     "0.0"
     )
    )

    Note, the "0.0" will give you whole number and one decimal position.  If you want no decimal, then change to "0"

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard