Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Percentage Calculation & Sumumarization

Hello, 

I have a table for purchase order data. I created a column with the following calculation to get the '%Spent'. [ % Spent] = DIVIDE('Orders'[Amount Expended], 'Orders'[Overall Limit]) . There can be 10 order entries for 1 purchase order and the %Spent  column is adding the percentage for each order and resulting in like 2000% spend. How can I fix this so the table will not add up each percentage for each line item, it should just say 90%.

  

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Calculated column couldn't show dynamic aggregation value like the sum of column 1 divided by the sum of column 2. You see if you create [%Spent] as a calcualted column, it will show you sum/max/ do not sum/ and so on based on the column result. You can try to create a measure to achieve your goal.

    Measure % Spent = DIVIDE(SUM('Orders'[Amount Expended]),SUM( 'Orders'[Overall Limit]))

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

11 Replies

  • Hi, Anonymous 
    You can use MAX function to take only one value for your Order.

    If you want a tailor-made solution, please share a copyable sample dataset. Thank you

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried playing around with the MAX function but it didn't resolve the issue.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Here is some sample data. This is what the line items look like. I've selected summarize so I get one line item per order. I get the correct totals for the Amount Expended and Amount Available. The problem is the percentage column, it's adding all of the line items and giving me 2602.78% instead of the percent 87.4% that I'm expecting.

    Order NumberLine NumberRequisition Line NumberRequested byProduct Or ServiceCatalog IndicatorOverall LimitAmount Expended % SpentAmount Available
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.37%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.25%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.38%$2
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.94%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.31%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
            2602.78% 
    • vojtechsima's avatar
      vojtechsima
      Super User

      Hi, Anonymous 
      I think simple 'Don't summarize' could do it, if you have your % spent as Calculated column

       

      • vojtechsima's avatar
        vojtechsima
        Super User

        Or Anonymous 
        If you want to show only one row as the SUM of all, just create a measure like this and put it as the new column into the Table Visualization:

        % Spent Measure = 
        DIVIDE(SUM(Percentages[Amount Expended]), SUM(Percentages[Overall Limit]))

         



  • Anonymous's avatar
    Anonymous
    Not applicable
    Order NumberLine NumberRequisition Line NumberRequested byProduct Or ServiceCatalog IndicatorOverall LimitAmount Expended % SpentAmount Available
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.32%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.34%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.31%$2
    0062178311-0111Doe, JohnProductCatalog$19$1791.37%$2
    0062178311-0144Doe, JohnProductCatalog$19$1791.25%$2
    0062178311-0155Doe, JohnProductCatalog$25$2391.38%$2
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.92%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.33%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
    0062178311-0133Doe, JohnProductNon-Catalog$41$2663.94%$15
    0062178311-0122Doe, JohnProductNon-Catalog$114$10491.31%$10
    0062178311-0166Doe, JohnProductNon-Catalog$65$5991.33%$6
            2602.78% 
  • Anonymous's avatar
    Anonymous
    Not applicable

    vojtechsima please see sample data set above in post. The 'Overall Limit' column totals correctly and so does the 'Amount Expended'. The percentage column is technically adding each line item but I don't want it to do that, I want it to take the percentage on the total Amount Expended for an order and Overall Limit.