The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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]))
Solved! Go to Solution.
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
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.
I am available to provide any additional information needed.
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