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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
sa34techer
Helper II
Helper II

Totals Not adding up correctly

My Power BI table is adding up to wrong total at $9.90.  The correct totals should be 8.795, based same data in excel. I am formatted a basic Revenue = SUM(Table[Revenue) measure.  Please look my measure, to see why it is not totaling correctly. 
 
Excel
 9.200
 0.156
 (0.360)
 (1.000)
 (0.140)
 0.102
 0.437
 0.400
Total8.795
 
Power BI Table
 
sa34techer_0-1735268742652.png

 

 
Revenue Formatted =
VAR _salesMeasure =
    SUMX ( VALUES ( Table[Company]  ), [Revenue] )
VAR _result =
    SWITCH (
        TRUE (),
        ABS ( _salesMeasure ) >= 1000000, FORMAT(ROUND(DIVIDE(_salesMeasure,1000000,0),1),"$0.00;$0.0##"),
        ABS ( _salesMeasure ) >= 100000,FORMAT(ROUND( DIVIDE(_salesMeasure,1000000,0),3),"$#0.000"),
        ABS ( _salesMeasure ) >= 10000,  FORMAT(DIVIDE ( _salesMeasure, 100000, 0 ),"$0.00;($0.00)"),
        ABS ( _salesMeasure ) >= 1000,  FORMAT(DIVIDE ( _salesMeasure, 10000, 0 ),"$0.00;($0.00)"),
     ABS ( _salesMeasure ) >= 100,  FORMAT(DIVIDE ( _salesMeasure, 1000, 0 ),"$0.00;($0.000)"),

        ABS ( _salesMeasure ) > 0, DIVIDE(  _salesMeasure, 100 )

    )
RETURN
    _result




1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin
If you can share the PBIX, it is much more expeditious to validate and solve your requirement
Please try the following formula.

SumTotOk :=
SUMX(
    // ------PLEASE CHANGE Table[Company] WITH THE COLUMN ITERATED AT THE VISUAL----------
    VALUES( Table[Company] ),
    CALCULATE(
        SUMX(
            Table,
            [Revenue]
        ),
        ALLSELECTED()
    )
)

I hope it is helpful, if so please accept the solution. Kudos are welcome😀

View solution in original post

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin
If you can share the PBIX, it is much more expeditious to validate and solve your requirement
Please try the following formula.

SumTotOk :=
SUMX(
    // ------PLEASE CHANGE Table[Company] WITH THE COLUMN ITERATED AT THE VISUAL----------
    VALUES( Table[Company] ),
    CALCULATE(
        SUMX(
            Table,
            [Revenue]
        ),
        ALLSELECTED()
    )
)

I hope it is helpful, if so please accept the solution. Kudos are welcome😀

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the problem there clearly.


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

Here is the sample data and problem measure (Formatted) I used.  WIl this work? I can't link to the PBIX

 

.1-60 Days = SUM('Table'[1-60 Days])
 
.Formatted =
VAR _salesMeasure =
    SUMX ( VALUES ( 'Table'[Company]  ), [.1-60 Days] )
VAR _result =
    SWITCH (
        TRUE (),
        ABS ( _salesMeasure ) >= 1000000, FORMAT(ROUND(DIVIDE(_salesMeasure,1000000,0),1),"$0.00;$0.0##"),
        ABS ( _salesMeasure ) >= 100000,FORMAT(ROUND( DIVIDE(_salesMeasure,1000000,0),3),"$#0.000"),
        ABS ( _salesMeasure ) >= 10000,  FORMAT(DIVIDE ( _salesMeasure, 100000, 0 ),"$0.00;($0.00)"),
        ABS ( _salesMeasure ) >= 1000,  FORMAT(DIVIDE ( _salesMeasure, 10000, 0 ),"$0.00;($0.00)"),
     ABS ( _salesMeasure ) >= 100,  FORMAT(DIVIDE ( _salesMeasure, 1000, 0 ),"$0.00;($0.000)"),
        ABS ( _salesMeasure ) > 0, DIVIDE(  _salesMeasure, 100 )
    )
RETURN
    _result
 
Data Below

Company1-60 Days61-90 

Company 19221346.25
Company 2155833.69
Company 3-36408.92
Company 4-999.97
Company 5-14441.8
Compnay 60
Company 7101983.53
Company 8437385.98
Company 90
Company 103967.72

 

sa34techer_1-1735272644816.png

 

Looks like a rounding error.  Share the download link of the PBI file.


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

@Syndicate_Admin
Taking the data from the table loaded in power bi, the calculations are correct in the power bi.

pcoley_0-1735279206206.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors