# Calculate Associated Total Costs of Context in Reverse Order

@Melissa

Any thoughts on my SUMMARIZE question from yesterdays post?

Best Regards
J

Hi @jprlimey,

Sorry completely read over that one… I expect you know that all attributes dragged into a visual provide filter context to measures placed in it. So in order to recreate the same filter context in your virtual table as generated by the Matrix visual you’ll need to include the same attributes in SUMMARIZE.

@Melissa

After doing more analysis, it turns out that we are correctly calculating the rejects costs when we have a single occurrence of a reject on a production order. In the image below we are showing the Reject table

As you can see the first record for Order A11682 Op No 50, we lost 15 parts for LEAK, the Cumulative Correct Reject Costs 2 measure returns \$393.81, this is correct.

However looking closer where multiple rejects occurred on the same production order we seem to have incorrect values for Cumulative Correct Reject Costs 2 measure. The image below is from the Confirmed table.

To this table I added an additional measure named Cumulative Std Costs Unit 1. This calculates the accumulated standard costs from the first Op No to the last Op No for each production order. Very quickly you can see that for Order A11909 Op No 130 we have \$43.30, whereas in the Reject table for the same order number we have 4 separate rejects, 3 of which are tied to Op No 130. As you can see the Cumulative Correct Reject Costs 2 has returned…

\$ 122.54 for qty 8 rejected for Depth … should be \$43.30 * 8 = \$364.40
\$275.72 for qty 18 rejected for O/S … should be \$43.30 * 18 = \$779.40
\$61.27 for qty 4 rejected for Depth … should be \$43.30 * 4 = \$173.2

and finally for Op no 140…

\$15.84 for qty 1 rejected for Depth … should be \$43.82 * 1 = \$43.82

I pondered this for some time yesterday, trying different variants of he Cumulative Correct Reject Costs 2 measure but was unsuccessful in resolving. I also checked my production model and I see the same issue.

I have attached the latest .pbix file

Not sure of where to go from here, as I’d previously stated we had a solution for the posting.

Best Regards
JExample 1 Rev-4.pbix (385.9 KB)

Any possible thoughts on where I go from here?

Do I need to start a new post?

Best Regards
John

Hi @jprlimey,

Sorry been swamped, haven’t had the time to revisit this. Creating a new topic makes it more visible so that is helpful - please do that.

Thank you.