Forum Discussion
Matrix row total not accurately calculating
I have a matrix viual that list rows for Division/Zone/Location # and provides the percent of inspections completed.
*Current matrix visual:
*Current calculation for the column in question:
*Calculation for [Completed Baler Inspections] :
- Anonymous2 years ago
Hi A_Scott ,
Thank you Greg_Deckler very much for the solution, and I've tried other ways to help you understand the problem:
You can use ISINSCOPE in DAX for contextual filtering if you want to use each row for counting and not each column.
% Baler Complete Average = IF ( SUM('Table'[Baler Count]) = 0, "N/A", IF ( ISINSCOPE('Table'[Location]), MIN(1, SUM('Table'[Completed Baler Inspections]) / SUM('Table'[Min. Baler Insp. Required])), AVERAGEX ( VALUES('Table'[Location]), MIN(1, SUM('Table'[Completed Baler Inspections]) / SUM('Table'[Min. Baler Insp. Required])) ) ) )Except for the % Baler Complete Average, which is all columns and does not use DAX,
you can remove my SUM function depending on the conditions and it should accomplish what you need as well.
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- Greg_Deckler
Community Champion
A_Scott First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
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- A_Scott
Helper I
I've read both of those articles and still not grasping how to make it apply to my senario...
- Greg_Deckler
Community Champion
A_Scott OK, can you post sample data.
- AnonymousNot applicable
Hi A_Scott ,
Thank you Greg_Deckler very much for the solution, and I've tried other ways to help you understand the problem:
You can use ISINSCOPE in DAX for contextual filtering if you want to use each row for counting and not each column.
% Baler Complete Average = IF ( SUM('Table'[Baler Count]) = 0, "N/A", IF ( ISINSCOPE('Table'[Location]), MIN(1, SUM('Table'[Completed Baler Inspections]) / SUM('Table'[Min. Baler Insp. Required])), AVERAGEX ( VALUES('Table'[Location]), MIN(1, SUM('Table'[Completed Baler Inspections]) / SUM('Table'[Min. Baler Insp. Required])) ) ) )Except for the % Baler Complete Average, which is all columns and does not use DAX,
you can remove my SUM function depending on the conditions and it should accomplish what you need as well.
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- A_Scott
Helper I
This worked perfectly. Thank you for your simple explination!