Forum Discussion
How to SUM a measure using MAX
I have a table in which I am trying to calculate product waste, the issue is I need to SUM the yield but only on the last entry for a particular document.
This is the forumla I am currently using which gives me exactly what I need in the rows, but in the table total it gives me the MAX instead of the tables SUM.
FILTER('Capacity Personnel',[Entry_No]=MAX([Entry_No])))
I see what you mean - have you considered creating a deduped version of the table then calculating for each row, eliminating the dedupe inside the calc?
7 Replies
- ThomVF
Advocate IV
Looks like it is giving you the last value calculated, not the MAX?
Are you using calculated columns or calculated measures?
- Kfausch
Helper II
It's actually doing both each line in the screen shot represents a Production Order where we produced an item. When we do this we log what the Expected Yield and Actual Yield was for the Production Order, but every once in a while our production crew double enters the yield by mistake. I am trying to only take the last entry for each Production Order and then sum all the totals. If I SUM all it counts the duplicates which I dont want.
My measure is taking the MAX entry number, in the total it is returning that MAX entry data rather than the SUM.
I hope I explained this well enough.
- ThomVF
Advocate IV
I see what you mean - have you considered creating a deduped version of the table then calculating for each row, eliminating the dedupe inside the calc?
- Kfausch
Helper II
I am currently trying with meausures, but I tried to make it work with calculated columns as well.
- ThomVF
Advocate IV
I found this tutorial/article - maybe it sheds some light on whats happening...
https://www.jetglobal.com/blog/calculated-columns-vs-measures/