Forum Discussion
Circular dependency issue
- Anonymous8 years ago
Thanks,
I implemeted it with Power Query iventually, using function to get the running total and then use it in User1Pct and User2Pct.
Regards,
Eran
Hi Anonymous,
In the table, User2 use the User2Pct, and User2Pct use User2, its' weird? At first, I was considering there are no User2 and the User2Pct columns in your resource table? While you must create one column based on another one? So there must be one in the begginning, but both of them depands on each other, the logic is uncorrect. Because the calculation is based on columns rather than rows. Could you please share your resouce table for further analysis?
Best Regards,
Angelia
Hi Angelia,
thanks for your answer.
the logic is, if [User] column shows "User1" then the Discounted Cashflow belongs to User1 - Formula: [Cashflow] * [2230.05] / [Price]. the same logic when "User2"appears in [User] column. however when [User] column has "Both", the discounted cashflow of -650,000 which is -648,331 should be shared between them ProRata to the ratio prior to this transaction, thus if prior to a "Both" row the sum of all rows of User1 is 800 and the sum of all rows of user2 is 200, the User1Pct should be 80% and user2Pct 20%, and the "Both" row cashflow equals to 500, then the User1 should have 80% of 500, and User2 should have 20% of 500, (User1 400, User2 100), in our case the ratio for user1, 64.92% out of the -648,331 (-420,922) and 35.08% out of the -648,331 (-227,409)
i have attached a link to an excel sheet with this logic, the excel does not have a circular dependecy as the calculation is based on a cell rather than a column.
could you suggest how to implement this in current way or a better way to implement this logic
https://www.dropbox.com/s/ihkoptlrt376wmr/CircularDependencyEx.xlsx?dl=0
kind regards,
Eran
- Anonymous8 years agoNot applicable
Any Ideas?
- v-huizhn-msft8 years agoMicrosoft Employee
Hi Anonymous,
I download your sample table and get the User column based on the PassDate, Crashflow and Prirce. After get User, we need to calculate User1 column, but User1 depands on User1Pct, but User1Pct has no value at first, how do you get value? For example: 739869=IF(OR(E4="Both",E4="User1"),C4/D4*$D$1*IF(E4="Both",H4,1),0), if there is H4 value, how do you calculate, it will return error?Please follow the steps to get user column.
1. Create a column using the formula:Column = VAR D=Table1[Row] RETURN CALCULATE(SUM(Table1[PassDate]),FILTER(ALL(Table1),Table1[Row]<=D))
2. Then create another calculated column using the formula.
User = IF(Table1[Column]=1,IF(Table1[Cashflow]<0,"Both","User2"),"User1")
Best Regards,
Angelia- Anonymous8 years agoNot applicable
Hi Angelia,
I fixed the User1Pct and User2Pct formulas:
User1Pct(first row) = IFERROR(SUM($H10:H$10)/SUM($H10:I$10), 1)
User2Pct(first row) =IFERROR(SUM($I10:I$10)/SUM($H10:I$10),0)
https://www.dropbox.com/s/ihkoptlrt376wmr/CircularDependencyEx.xlsx?dl=0
Regards,
Eran