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 / How can you calculate ...
Power Apps
Answered

How can you calculate the Average in a DataTable Column?

(0) ShareShare
ReportReport
Posted on by 8

I have a calculated column in a DataTable. DataTable1, the calculated column name is Trunc.

 

How do I calculate the average of Trunc?

 

Thanks,

Jim

Categories:
  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    Hi @GandT Average(DataTable1,Trunc) this will be the average of the whole Trunc column

     

    hope it helps

     
  • GandT Profile Picture
    8 on at

    Thanks I tried that again just now and I get this..

    GandT_0-1613748544186.png

     

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @GandT  seems like the type of data is text, try Average(DataTable1, Value(Trunc))

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

    Hi @GandT 

    You may need to replace DataTable1 in your formula with the actual Items property of the datatable itself.  I found by experimentation, that if you use a gallery instead of a datatable, that your formula works but it requires Gallery1.AllItems, something that is not available in a datatable.  In the screenshot, the average works for the gallery but not the datatable.  However, if I replace DataTable2 in the formula with 

    Average(
     Filter(
     sales, Country=Dropdown2.Selected.Result),'Units Sold'
     )
    )

    , then it works fine.  FYI, you can design a gallery to look identical to a datatable and it is a much more flexible control. 

    _1.png

  • GandT Profile Picture
    8 on at

    Using your suggestion, I did finally get it to work. The data was in a Datatable, the interim calculations were in a Gallery and the Average was in a TextInput box.  Convoluted, but it worked.  Thanks again.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard