Forum Discussion
Circular Dependency
Hi Guys,
I'm facing a circular depedency error.
Here is the background:
I have to create a calculated column, which has the logic... if the month number is 1 then a result from a column imported from database (this part is working), if month number is NOT 1 then it has to look for the previous value of addition of two current column values.
Now, the addition of two columns --> these two columns are also have to be a calculated column which is referring back to the column.
let's say the logic is in the 6th cell:
Z = If ( month6 <>1, AA5+AC5, K6 )
AA = Z-V
AC = AA-K
As Here in formula Z, if the month value is not 1 then it has to go to the previous row of addtion of two values of a calculated column.
The dax formulas are:
Now in order to look for previous row, I've created an index and prev index, and put that in the lookupvalue function (lookup is working). But when it comes to col AA and AC it referes back to Z.
In the formula above:
AA+AC is
Solution Tried:
- Making measure instead of columns: at the end lookupfunction has to be used, and in that col input is mandatory.
- Breaking up the formula: done this as well, but as soon as it gets to measure, i have to look for month value in first formula (open Inv BI), col names doesnt come in measure, need to use any function, now in order to find the respective month value, either i use lookup or any other function. (means its creating the same issue here again, lookup the value, again lookup the value and it goes on).
- Table Relationship: There's no issue in table relationship, as it is being done in the same table, there's no other reference table.
- Creating table for each col: Not a dynamic solution as this Open Inv BI formula reference is used in more than 15 col, and based on this many col are interconnected.
- Using Calculate function:
- created with calculated function with all except to primary key.
- Also tried creating with calculated function with all except to combination of other col which are geeting used.
Idrissshatila Ahmedx amitchandak Ritaf1983 parry2k Greg_Deckler Ashish_Mathur MFelix
Do give some advice, on how to solve this error
6 Replies
- IdrissshatilaSuper User
- Kaustubh_94New Member
At power query level, I think we cannot create calculated columns based on another calculated columns. Column can only be created based on columns which are imported from data source.
- IdrissshatilaSuper User
yes, exactly so create the first created column in power query.