Forum Discussion

NadiaHap's avatar
NadiaHap
Frequent Visitor
3 years ago
Solved

column sum incorrect

Hello everyone!
I'm having a problem with the column sum being calculated incorrectly.

I need to find value 2 (J2), formula =1/SUM(G2:G4)/(1+I2)-1

 

But for this, need to correctly calculate the amount per column G, it should be 0.6784. Formula =F2/(E2+1)/(C2+1)


I got to point 5 and got stuck...
1. budget = SUM('table[budget sum])
2. % budget = [budget]/CALCULATE([budget],ALLSELECTED('table'[Month])
3. budget without discount 1 = SUMX('table','table'[budget sum]/(1+'table'[discount 1]))
4. Value 1= [budget]/[budget without discount 1] - 1
5. % budget/ discount 3/discount 1 = [% budget]/(SUM('table'[discount 3])+1)/(SUM('table'[discount 1])+1) - mistake

I will be grateful for any help!

5 Replies

  • Hi NadiaHap ,

     

    Looking into the numbers something is not matching because the discount of -5% is not 10.005 if you do 0.5% 

     

    Are you abble to share the excel file where you have the calculations?

  • Hi, NadiaHap 

    According to your description, the Total in the [% budget/ discount 3/discount 1] measure is not you need. You need to get the sum of the value . Right?

    Here are the steps you can refer to :
    (1)This is my test data:

    The [% budget/ discount 3/discount 1] measure in my side is look like this:

    % budget/ discount 3/discount 1 = var _dis3 = MAX('Table'[discount 3])
    var _dis1 = MAX('Table'[discount 1])
    return
    [% budget]/(_dis3+1)/(_dis1+1)

    (2)Then we can create another measure based on this measure:

    % budget/ discount 3/discount 1 End result = var _t =SUMMARIZE(ALLSELECTED('Table'),[Month],"% budget/ discount 3/discount 1",[% budget/ discount 3/discount 1])
    return
    IF(HASONEVALUE('Table'[Month]) , [% budget/ discount 3/discount 1] , SUMX(_t,[% budget/ discount 3/discount 1]))

    (3)Then we put this measure on the viusal , we can get the Total you want in the end:

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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