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 / Calculating an average...
Power Apps
Answered

Calculating an average of a filtered sharepoint list

(0) ShareShare
ReportReport
Posted on by 166

Hello everyone,

i would like to get statistic values of a sharepont list.

We organize suggestions for improvement of our employees and i would like to know what is the average duration between submit date and enddate of a suggestion. This average shall only consider suggestions that were submitted in a defined period of time.

To clarify what i mean i show a table:

 

SuggestionIDSubmitDateEnddate
101.05.202220.05.2022
201.06.202210.06.2022
301.01.202310.01.2023

 

For example evaluationperiod is 01.01.2022 to 31.12.2022

- Suggestion ID3 will not be considered.

- For ID1 the processing time is 20 days, for ID2 it is 10 days.

- So the average for 2022 is 15 days.

 

How do i put this into a formula?

 

Looking forward for your help!

Jürgen

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @JürgenD

    Average(AddColumns(table, "worked", DateDiff(SubmitDate, EndDate), worked}) 

  • JürgenD Profile Picture
    166 on at

    Thank you for your help,

    unfortunately it does'n work:

    PowerApps tells me:

    "Invalid argumemt type table. Instead, a number value is expected"

    Average(AddColumns(BVW_Vorschlag; "Duration";DateDiff(VorschlagsDatum;Abschlussdatum)))

    What is the second "worked" in the formula for? And hwat about this closing bracket }?
    Can you help again, please?

  • Verified answer
    WarrenBelz Profile Picture
    155,171 Most Valuable Professional on at

    @JürgenD ,

    Firstly the formula posted by @Drrickryp is correct if placed in a Label on the screen, but your translation to your values is missing the field to average - it should be

    Average(
     AddColumns(
     BVW_Vorschlag; 
     "Duration";
     DateDiff(
     VorschlagsDatum;
     Abschlussdatum
     )
     ),
     Duration
    )

    If you want a specific period, add a couple of Date Pickers

    Average(
     AddColumns(
     Filter(
     BVW_Vorschlag;
     SubmitDate >=SubmitDatePicker.SelectedDate &&
     EndDate <= EndDatePicker.SelectedDate 
     ); 
     "Duration";
     DateDiff(
     VorschlagsDatum;
     Abschlussdatum
     )
     ),
     Duration
    )

     

  • JürgenD Profile Picture
    166 on at

    Hello Warren,
    thank you again for your help. After many years of programming with VBA i still have problems to understand the powerapp syntax. Now i got it - at least in this case :-).  Thanks to Derrick too.
    I am happy bout people like you for their help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard