Forum Discussion
Error: circular dependency
- 10 years ago
I assume these are calc columns, is that correct? I am aware of a circular dependency "issue" when you write multiple calc columns, and their incrementally refer to all columns in a table. It is very complex and I don't think I can explain it based on what I see. But my suggestion is that you don't write calc columns at all, but instead write measures. Read my article about the difference here. http://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
can you post the formula please? Also, translate?
QP Row Count = IF(COUNTROWS(RELATEDTABLE(QP))>0;COUNTROWS(RELATEDTABLE(QP)); 0)
Difference From Prior Month = 'Variação'[QP Row Count] - CALCULATE(SUM('Variação'[QP Row Count]);DATEADD('Variação'[Date];-1;MONTH))data is date
variação is variation
:)
- MattAllington10 years agoCommunity Champion
I assume these are calc columns, is that correct? I am aware of a circular dependency "issue" when you write multiple calc columns, and their incrementally refer to all columns in a table. It is very complex and I don't think I can explain it based on what I see. But my suggestion is that you don't write calc columns at all, but instead write measures. Read my article about the difference here. http://exceleratorbi.com.au/calculated-columns-vs-measures-dax/
- Kashuo9 years agoHelper I
Hi, I have a similar problem to the original poster.
I would be happy to use a measure, as in the tabular view it gives me the result I need.
However, you can't use a sliding date slicer with measures, only columns. Any ideas?
- MattAllington9 years agoCommunity Champion
Why can't you put the slicer on the date column in your calendar table?
- gonrodrigues10 years agoHelper III
- TimKroemer9 years agoFrequent Visitor
Hi Matt
Appreciate this is an old thread however I am facing the same issue - I am trying to calculate the maximum date in another table (that has been linked by a unique ID) - specifically, I have a table of Material Requests and a table of Purchase Orders - I want to know when was the last date that a Purchase Order was raised against this particular Material Request.
The formula I am trying to use is as follows:
Column = CALCULATE(MAX(PO[PO Date]),FILTER(PO,PO[UID]=EARLIER(MR[UID]))
this is giving me a circular dependancy error. I have tried taking your advice and using a measure but (at least at the auto complete level), this does not allow me to compare the UID in the PO table to the UID in the MR table.
I hope this is clear - any guidance or advice would be hugely appreciated.
Gratefully,
Tim
- MattAllington9 years agoCommunity Champion
well it looks to me like there is nothing wrong with your calc column. The issue is likely to be that you have other calc columns already. If your table doesn't have a primary key, you can't create multiple calc columns. Does this data need to be in your fact table? could you instead create a new calculated table that has this information? That should solve the problem