cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SytzeVisser
Frequent Visitor

Sum() of fields in Table limited?

The following Sum() function works fine:

 

Sum(
    Filter(varBigTable;
        Year=varReviewYear;
        Quarter=varReviewQuarter; 
        KPAname=ThisItem.Result
    ); (KPIselfscore/5)
);

 

However, I need to divide the answer of "Sum(KPIselfscore/5)" with sum of the KPIweight's like this:

 

Sum(
    Filter(varBigTable;
        Year=varReviewYear;
        Quarter=varReviewQuarter; 
        KPAname=ThisItem.Result
    ); (KPIselfscore/5)/(KPIweight)
);

 

...but this does not work. It does not throw an error. It just ignores the "/(KPIweight)" part. I tried a few variants such as:

  • (KPIselfscore/5)/(KPIweight)
  • (KPIselfscore/5/KPIweight)
  • (KPIselfscore/5)/KPIweight

Always gives the same result, i.e. only calculating (KPIselfscore/5) and ignores the rest of the formula. I am trying to avoid using two Sum() functions to achieve this.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @SytzeVisser ,

What is KPI weight (is it a field in the table?) - if so

Sum(
   AddColumns(
      Filter(
         varBigTable;
         Year=varReviewYear;
         Quarter=varReviewQuarter; 
         KPAname=ThisItem.Result
      );
     "KPI";
     KPIselfscore/KPIweight
   );
   KPI
)/5

If it is a fixed variable, try this

(
   Sum(
      Filter(
         varBigTable;
         Year=varReviewYear;
         Quarter=varReviewQuarter; 
         KPAname=ThisItem.Result
      );KPIselfscore
   )/5
)/KPIweight

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

 

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @SytzeVisser ,

What is KPI weight (is it a field in the table?) - if so

Sum(
   AddColumns(
      Filter(
         varBigTable;
         Year=varReviewYear;
         Quarter=varReviewQuarter; 
         KPAname=ThisItem.Result
      );
     "KPI";
     KPIselfscore/KPIweight
   );
   KPI
)/5

If it is a fixed variable, try this

(
   Sum(
      Filter(
         varBigTable;
         Year=varReviewYear;
         Quarter=varReviewQuarter; 
         KPAname=ThisItem.Result
      );KPIselfscore
   )/5
)/KPIweight

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

 

 

SytzeVisser
Frequent Visitor

It's a field in a table. It looks so obvious when you see the solution.

Great solution. Many thanks!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (4,158)