Forum Discussion
hchauhan556
2 years agoFrequent Visitor
how to remove A circular dependency
I got the error of Circular dependency. codes of two diff measures are. Inventory = VAR CurrentMonthInventory = SUM(CurrentInventory[Quantity]) VAR LastMonthInventory = CALCULATE([Ending I...
danextian
2 years agoSuper User
Hi hchauhan556 ,
This is where you problem lies.
Inventory =
VAR CurrentMonthInventory = SUM(CurrentInventory[Quantity])
VAR LastMonthInventory = CALCULATE([Ending Inventory], PREVIOUSMONTH('Date'[Date]))
RETURN
IF(CurrentMonthInventory = 0, LastMonthInventory, CurrentMonthInventory)
Your Inventory measure references Ending Inventory but Ending Inventory also references Inventory. If you did the same thing in Excel, you'd also get a similar error.
hchauhan556
2 years agoFrequent Visitor
Hi Danextian
both measures are mandatory and dependent on each other. how can I remove circular dependency on that point?
kind regards