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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,558)