Forum Discussion
Matrix Table not giving the correct total amount
I have created the below meaure that is being implemented in a Matrix table that the column vendor is being pulled from a helper table called Vendor_template which has specific vendors as rows along with a total row. The measure gives me the correct amount for each vendor but when it comes to the total row it is not adding up correctlty. I have added a screenshot below of the issue along with the full measure. Any help would be greatly appreciate
It would have been easier for us to provide a solution had you provided a sample pbix (confidential data removed). But just given what's available, here's what I would try: Keep a separate measure for vendor level only. Create another measure to return the total
TotalSellPrice_BillsReceived - Vendor and Total = IF ( SELECTEDVALUE ( Vendor_Template[Vendor Reference] ) = "Total", SUMX ( VALUES ( VendorProjectType[Manufacturer] ), [TotalSellPrice_BillsReceived - vendor] ), [TotalSellPrice_BillsReceived] )
7 Replies
- Greg_DecklerCommunity Champion
sajohnson05 First, please vote for this idea: https://community.fabric.microsoft.com/t5/Fabric-Ideas/Matrix-Table-grand-totals-with-Measures/idi-p/4475982
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8 - Ashish_MathurSuper User
Hi,
Share the download link of the PBI file. Show the problem and expected result there.
- danextianSuper User
It would have been easier for us to provide a solution had you provided a sample pbix (confidential data removed). But just given what's available, here's what I would try: Keep a separate measure for vendor level only. Create another measure to return the total
TotalSellPrice_BillsReceived - Vendor and Total = IF ( SELECTEDVALUE ( Vendor_Template[Vendor Reference] ) = "Total", SUMX ( VALUES ( VendorProjectType[Manufacturer] ), [TotalSellPrice_BillsReceived - vendor] ), [TotalSellPrice_BillsReceived] ) - AnonymousNot applicable
Hi sajohnson05 ,
Thank you for reaching out to the Microsoft fabric community forum.
As correctly mentioned by Greg_Deckler , this is a classic case of the “measure totals” issue in Power BI where total rows in visuals (like matrix tables) don’t aggregate row-level logic correctly due to context differences. While your measure works per vendor, the "Total" row needs special handling. danextian provided solution separate the measure logic into two parts: one for vendor-level ([TotalSellPrice_BillsReceived - VendorOnly]), and another that uses SUMX over manufacturers to calculate the total row correctly. You can then wrap both in a final measure using an IF condition based on "Total". This ensures accurate totals and preserves your fiscal year logic per vendor.
Hope this helps. Please reach out for further assistance.
Thank you.
- AnonymousNot applicable
Hi sajohnson05 ,
I wanted to follow up on our previous suggestions. We would like to hear back from you to ensure we can assist you further.
Thank you.
- AnonymousNot applicable
Hi sajohnson05 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
- AnonymousNot applicable
Hi sajohnson05 ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.Thank you.