Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
NadiaHap
Frequent Visitor

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

NadiaHap_0-1669735624461.png

 

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!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yueyunzh-msft
Community Support
Community 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:

vyueyunzhmsft_0-1669778524108.png

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:

vyueyunzhmsft_2-1669778638959.png

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

MFelix
Super User
Super User

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?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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=10029...

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]) )-1

 

The other metrics are ok.

MFelix_0-1669800054727.png

See PBIX file attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.