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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

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/
Anonymous
Not applicable

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors