Forum Discussion
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
- NadiaHapFrequent Visitor
sorry, because of the format, it was divided by 100 again. I fixed the screenshot.
Link to the Google spreadsheet - https://docs.google.com/spreadsheets/d/1a05fkpmq9-rYZifgMt3i8UaaxDt8lbFa/edit?usp=sharing&ouid=100298040816949354403&rtpof=true&sd=true- MFelixSuper User
Hi NadiaHap ,
I have looked at your file and believe that you need to create the following measures:
Budget without discount = SUMX ( 'Table', DIVIDE ( [Budget], ( 1 + 'Table'[discount 1] ) ) )value 2 = VAR temptable = SUMMARIZE ( 'Table', 'Table'[ Month], 'Table'[ budget sum], 'Table'[discount 1], 'Table'[discount 3], "%BUd", [% Budget] ) RETURN SUMX ( temptable, 1 - DIVIDE ( DIVIDE ( [%BUd], ( 'Table'[discount 3] + 1 ) ), ( 1 + 'Table'[discount 1] ) ) ) Final Value = DIVIDE(DIVIDE(1, [value 2]), (1+ [value 1]) )-1The other metrics are ok.
See PBIX file attach.
- Ashish_MathurSuper User
- v-yueyunzh-msftCommunity Support
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