Forum Discussion

kblevs's avatar
kblevs
Frequent Visitor
6 years ago
Solved

Calculate Profit Margin %

I'm struggling to calculate profit margin %.

 

Before summation of % Profit Margin

SO      Dock Date      Sum of COGS      Sum of Total Price      Sum of Total      Profits % Profit Margin
961       4/8/2020             $8,074.41                   $2,982.00         ($5,092.41)                            -170.77%
961       4/8/2020                    $0.00                 $10,437.00         $10,437.00                              100.00%

 

After summation of % Profit Margin

SO   Dock Date      Sum of COGS       Sum of Total Price              Total Profit      Sum of % Profit Margin
961    4/8/2020             $8,074.41                $13,419.00                  5,344.59                                  -70.77%

 

As you can see the profit margin is not correct.

 

I have a SO with multiple line items on it. I have summed up the SO line to calculate COGS, Total Price of the assembly. Then, I created a measure to calculate profit.

Total Profit = [Total Price] - [COGS]

 

% Profit Margin = Divide([Total Profit], [Total Price], 0)

  • kblevs's avatar
    kblevs
    6 years ago

    I have solved this by adjusting my query and pulling data in another way. Please disregard.

8 Replies

  • kblevs ,

    I am hoping those are measures and not columns and formula is Actually

    % Profit Margin = Divide(sum(Table[Total Profit]), sum(Table[Total Price]), 0)

    • kblevs's avatar
      kblevs
      Frequent Visitor

      They are all columns except for Total Profits. I have already tried to sum total profits and total price. Here are those results.

       

      % Profit Margin = DIVIDE(SUM(Query1[Total Profit]), SUM(Query1[Total Price]),0)


      SO      Dock Date      Sum of COGS      Sum of Total Price      Sum of Total Profits      % Profit Margin
      961       4/8/2020             $8,074.41                  $13,419.00                      $5,344.59                   40.02%

       

      That actually gives me 40.02% for every row.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi kblevs,

    Is this formula nested with multiple measure formulas or direct calculated with table fields?  Can you please share some dummy data and measure formulas with a similar data structure to test?  It will help us clarify your score and test to coding formula.

    How to Get Your Question Answered Quickly 

    In addition, your scenario looks like a common measure total calculation issue, perhaps you can take a look at the following link about measure total issues:

    Measure Totals, The Final Word 

    Regards,

    Xiaoxin Sheng

    • kblevs's avatar
      kblevs
      Frequent Visitor

      Hi Anonymous 

       

      COGS column is a conditional column to make sure that cogs are only calculated once for each SO. Otherwise, the raw data (cost column) would multiply with the multiple lines on a SO. But, the COGS only goes against the SO once.

       

      LineSOAssemblyQTYDock DateUnit PriceTotal PricecostCOGSTotal Profit
      11053303380594/6/202033.001947.002058.942058.94-111.94
      21053TOOLING14/6/2020300.00300.002058.940.00300.00
      31053STENCIL14/6/2020225.00225.002058.940.00225.00
      41053EXPEDITE FEE14/6/2020696.60696.602058.940.00696.60
      5105330338014/6/202033.0033.002058.940.0033.00
      11054303370594/7/2020228.7513496.2511158.8111158.812337.44
      21054TOOLING14/7/2020300.00300.0011158.810.00300.00
      31054STENCIL14/7/2020225.00225.0011158.810.00225.00
      41054EXPEDITE FEE14/7/20202981.402981.4011158.810.002981.40
      5105430337014/7/2020228.75228.7511158.810.00228.75
      110585945.576.18214/15/202056.501186.50460.58460.58725.92
      11071400520254/24/202066.001650.00977.12977.12672.88
      19444009562884/2/202046.7513464.007276.187276.186187.82
      19454009562884/22/202046.7513464.007282.567282.566181.44
      1950CT 41315563/18/202047.502660.009166.419166.41-6506.41
      1951CT 496462164/8/202022.254806.002915.132915.131890.87
      1952CT 49652603/25/202027.501650.001023.341023.34626.66
      1958CT 41305484/15/202015.00720.00382.09382.09337.91
      1959CT 47790224/15/202043.00946.00558.58558.58387.42
      1960CT 413141084/1/202037.254023.002489.172489.171533.83
      1961CT 53448564/8/202053.252982.008074.418074.41-5092.41
      2961CT 534481964/8/202053.2510437.008074.410.0010437.00
      • kblevs's avatar
        kblevs
        Frequent Visitor

        Bump

         

        Does anyone have any other suggestions? I have not been able to get this to work.