Forum Discussion
Dynamic SUMIFS function into calculated column by DAX
Dear Ashish_Mathur,
You are right, in my current example I have the same figuers in Column C and my simulation Column H. I did this to test the behavior of the transactions when calculating the weighted average.
Let's go a little further to H7.
I decide that the purchase from 04/03/2019 160 pieces should have an account assignment not T.01.03.01, but T.01.03.02 (it's error).
It means for H7 calculation that we no longer have additional 4225828,46 in the numerator and additional 160 pieces in the denominator.
So, calculation for H7 was:
( 2431082,5 - 799260 + 4225828,46 ) / ( 146 - 48 + 160 ) * - 1 = - 22704,07 - before changing WBS Element
And then
( 2431082,5 - 799260 ) / ( 146 - 48) * - 1 = - 16651,25 - after changing WBS Element
My task to understand this delta (before and after WBS changing). But It's possible for me only by, as you said, the complicated SUMIFS() function with dynamic range.
Not sure i understand your logic, the purchase from 04/03/2019 has a positive Total Quantity, which bypasses the SUMIF logic, value of H is 4,225,828.46. The SUMIF only deals with negative Total Quantities. How do you determine that the values are assigned to the incorrect account and if we are doing an account reassignment, could we not just update the WBS Element? then do a straight sum using the reassigned WMS Element to group by.
Sorry if I am being dense.
Richard
- MKushpil6 years agoRegular Visitor
Dear richbenmintz,
My example shows the fact that there is in SAP. But for 4,225,828.46 account is worng (It's my personal de facto decision, not formula result). This purchase in euro, that's why I need change account and then in my second transaction I will have negative effect, because my fact weighted average bigger than should be. And every previous buy/write off transaction is in formula, therefore, I don't know how to avoid it.(
- richbenmintz6 years agoResident Rockstar
Sorry but I think I am at a loss here, not sure i understand exactly what you are doing and pretty sure that the sum of the sum of the same calculation is not supported. If you can come up with an alternate way to weight and sum your data I could try again.
Sorry
Richard