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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,385)