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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
leonekd
Frequent Visitor

Sum of individual values in a Table is wrong

Hello,

I'm experiencing difficulties with calculating 
the sum of individual rows (Material's profits) in a table. The value shown in the visual is different from the real sum value:

leonekd_0-1691431973864.png

I concluded this by extracting the table data and doing a SUM in excel.

DAX formulas used:

SAVING = CALCULATE((TABLE[Preço Un. PONDERADO]-TABLE[PONDERADO UNIT LAST YEAR])*TABLE[QTD LASTYEAR])

 

Preço Un. PONDERADO = CALCULATE(DIVIDE(SUM(TABLE[PreçoUn * QNT]),SUM(TABLE[Qtd.do pedido])),'CALENDÁRIO'[ANO] = 2023)

 

PONDERADO UNIT LAST YEAR = CALCULATE(DIVIDE(SUM(TABLE[PreçoUn * QNT]),TABLE(EXPD[Qtd.do pedido])), SAMEPERIODLASTYEAR('CALENDÁRIO'[DATA]))

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @leonekd ,

Please try:

New Measure =
SUMX (
    SUMMARIZE ( 'Table', 'Table'[Material], 'Table'[Texto breve] ),
    [SAVING]
)

If this doesn't work, please consider providing a test file that does not contain private data.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @leonekd ,

 

Please try:

New Measure = 
SUMX (
    VALUES ( 'Table'[Material] ),
    [SAVING]
)

Why Power BI totals might seem inaccurate

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi @Anonymous , thank you for the answer,

It seemed to work at first because the total was really close to the true value. But comparing with the values ​​line by line below, I realized that some values did not match (as seen in line 2 - 30078967 ABACAXI IN NATURA). The value in black (original) is correct row by row, but not the sum total.

leonekd_0-1692301707954.png

I am available to provide any additional information needed.

 

Anonymous
Not applicable

Hi @leonekd ,

Please try:

New Measure =
SUMX (
    SUMMARIZE ( 'Table', 'Table'[Material], 'Table'[Texto breve] ),
    [SAVING]
)

If this doesn't work, please consider providing a test file that does not contain private data.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors