Forum Discussion
Inconsistent Sum/Total in Matrix
- 1 year ago
Hi Msampedro ,
Thanks for getting back. Yes, the main issue was due to how the many-to-many relationship between the Net Sales and Mapping tables allows a single material to be associated with multiple layers. This causes the matrix visual to re-evaluate the total across all matching combinations, including ones not directly visible in the row-level breakdown - which results in a higher total.
To fix this, here is a measure that explicitly sums Net Sales per unique Material–Layer combination from the Mapping table.
Net Sales (Fixed Total) = SUMX( SUMMARIZE( 'Mapping', 'Mapping'[Material], 'Mapping'[Layer] ), CALCULATE(SUM('Net sales'[Net Sales])) )This forces the matrix to total exactly what is shown in the rows, avoiding the context from the many-to-many relationship. With this change, the matrix total now becomes 29.73M.
Hope this helps. Please reach out for further assistance.
Please find the attached .pbix for reference.
Thank you.
Hi Msampedro ,
Can you please share what is the calculation you are using to get this values?
I believe this is a context based the sum of values that are dependent on other calculations may return incorrect results in aggregations at different levels depending on the aggregator column.
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.