Forum Discussion
Anonymous
1 year agoNot applicable
PowerBI Wrong Total Sum
Hi, PowerBI Community, I have a problem with this. I have measures like this: ppu_ac, ppu_ly. I use this in "Matrix" visual. For the calculation, I used this formula, simple division with DIVIDE: ...
- 1 year ago
Problem: DIVIDE([AC Revenue], [Ac_hl]) works per row, but totals in Matrix aggregate first, then divide — causing wrong results.
Fix: Use SUMX to force row-wise calculation even in totals:
ppu_ac_fixed =
SUMX(
VALUES('Tabulka'[Dimenze]),
DIVIDE([AC Revenue], [Ac_hl])
)
Optional: Wrap with HASONEVALUE if you want different logic for rows vs totals. - 1 year ago
Hi Anonymous
For the total alone try using SUMX:
ppu_ac_custom = IF( HASONEVALUE('Tabulka'[Dimenze]), DIVIDE([AC Revenue], [Ac_hl]), SUMX( VALUES('Tabulka'[Dimenze]), DIVIDE([AC Revenue], [Ac_hl]) ) )
MohamedFowzan1
Super User
1 year agoHi Anonymous
For the total alone try using SUMX:
ppu_ac_custom =
IF(
HASONEVALUE('Tabulka'[Dimenze]),
DIVIDE([AC Revenue], [Ac_hl]),
SUMX(
VALUES('Tabulka'[Dimenze]),
DIVIDE([AC Revenue], [Ac_hl])
)
)Anonymous
1 year agoNot applicable
Thank you, it works :))