Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Incorrect Total for Calculated Column

Hi

I have a calculated column called Percentage that shows the percentage of Col2 that is contained in Col1 (Simply: Col1/Col2 as a %). An example is shown below:

 

Col1Col2Percentage
10 100  10,00%
5 50000  0,01%
5000 20000  25,00%
5015 70100  35,01%

 

The issue is that the total row (shown in bold) sums up the percentages from the rows above (10% + 0.01% + 25% = 35.01%). What I WANT it to do is to follow the same calculation logic as the preceding rows. In this case the answer I expect would be (5015/70100 = 7.15%). How can I do this?

  • Hi Anonymous 
    Add column1 and column2 as measures. For example
    Total Column1 = SUM ( TableName[Column1] )
    Total Column2 = SUM ( TableName[Column2] )

    Then:

    Percentage Measure = DIVIDE ( [Total Column1], [Total Column2] )

1 Reply

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 
    Add column1 and column2 as measures. For example
    Total Column1 = SUM ( TableName[Column1] )
    Total Column2 = SUM ( TableName[Column2] )

    Then:

    Percentage Measure = DIVIDE ( [Total Column1], [Total Column2] )