Forum Discussion

John_Peter's avatar
John_Peter
Regular Visitor
6 years ago
Solved

Percentage Total calculation

Hi Power BI,


I have a matrix with a column of%, it seems that the grand total of this column is the sum of the column, how can I do to make the% only at the level of the Grand Total?

 

For example if I take line 1 the calculation of Gross $ is
Gross $ = (Sales [Sales] -Sales [Gross_Cost]) + (Sales [Sales] * Sales [Customs_Rate]) + (Sales [Sales] * Sales [Cust_Disc])

 

But the calculation of the grand total for Gross % is not OK,

Gross% = DIVIDE (Sales [Gross $], Sales [Sales], 0)

he should have been
(1343.59 / 1940.20) = 69% and not 793.83%

 

 

Probably itโ€™s very simple but Iโ€™ve been trying to understand for too long,

Thanks in advance ๐Ÿ™‚

 

  • It looks like these are calculated columns rather than measures. If so, this is the opposite of what 99% of people complain about powerbi totals (The values are being added up).

    If Gross% is written as a measure, I think you'll get what you want.  Obviously I can't see your source data so that's a semi-educated guess.

7 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    It looks like these are calculated columns rather than measures. If so, this is the opposite of what 99% of people complain about powerbi totals (The values are being added up).

    If Gross% is written as a measure, I think you'll get what you want.  Obviously I can't see your source data so that's a semi-educated guess.

    • John_Peter's avatar
      John_Peter
      Regular Visitor

      Thanks,

       

      Then i will change the column to a Calculated columns ๐Ÿ˜€

      • v-kelly-msft's avatar
        v-kelly-msft
        Community Support

        Hi John_Peter ,

         

        Is your issue solved?Can you make it as answered to close it?

         

         

        Best Regards,
        Kelly
        Did I answer your question? Mark my post as a solution!
    • Anonymous's avatar
      Anonymous
      Not applicable

      I am having the same issue.  However, I am using a measure.  Do i have to make it a calculated column? Below is my Measure.

       
      Utilization = (sum(DirectLabor[ActualHours])+(CALCULATE(InDirect[Set Up]/3)))/CALCULATE([Avail])

       

       

      • John_Peter's avatar
        John_Peter
        Regular Visitor

        Hi Anonymous 

         

        My Percentage is a Measure

         

        Gross% = DIVIDE(SUM(Ventes[Gross$]),SUM(Ventes[Sales]),0)
         
        Gross$ is a calculated Columns and Ventes[Sales] is a Column
  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi John_Peter ๏ผŒ

     

    Use the following measure :

     

    Gross %=DIVIDE (SUM(Sales [Gross $]), SUM(Sales [Sales]), 0)

     

     

    Best Regards,
    Kelly
     
    Did I answer your question? Mark my post as a solution!