Forum Discussion
Need Help on Circular Dependencies
Hi All,
i need to create a calculated column in SSAS Tabular Model for the below Usecase
QuantityInKg:
For RMA (i.e TType = 'RMA-Domestic') OR (TtType = 'RMA-Exports')) when Secondary Qty is null then PrimaryQuantity/ConversionFactor
Else if item like 'F%' then SecondaryQuantity else Null
PrimaryQuanity is available in Sales Table),
SecondaryQuanity (qty in kg) is available in Sales Table),
ConversionFactor is available in Items table
I created the column with the logic as below
=if(Sales[SecondaryFulfilledQuantity]=blank(),DIVIDE(Sales[PrimaryFulfilledQuantity],LOOKUPVALUE(Items[ConversionFactor],Items[HdaaS_ItemHashKey],SalesReport[HDaaS_ItemHashKey]),0),if(left(Sales[ItemKey],1)="F",Sales[SecondaryFulfilledQuantity],blank()))
Based on the Above iam trying to create another Calculated column for other usecase which is
QuantityInSQM = QuantityInKg / (ProductGSM /1000)
SecondaryQuanity (qty in kg) is available in Sale Table),
ProductGSM is available in Items table
i created a formula as =DIVIDE(SalesReport[PrimaryFulfilledQuantity],DIVIDE(LOOKUPVALUE(Items[ConversionFactor],Items[HdaaS_ItemHashKey],SalesReport[HDaaS_ItemHashKey]),1000,0),0) .but iam getting Circular dependency error as below
Could some one please help me on this.
Regards
Anitha
2 Replies
- amitchandak
Super User
Are these calculated columns QuantityInKg or (ProductGSM
refer if this can help to resolve
https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/
- AnonymousNot applicable
Hi anithaMallam,
Circular dependency often appears when you calculate across multiple table fields or reference between different calculate columns. I'd like to suggest you use 'all' functions to break the relationship when you try to extract values for calculating or change to use measure formulas, they has better compaitlisy on cross-reference.
Regards,Xiaoxin Sheng