Forum Discussion
Circular dependency - looking for suggestions
MagikJukas Instead of using SUMIFS, you can use DAX functions like SUMX or FILTER to iterate over tables and perform calculations.
DAX
RequirementFromAbove =
IF (
Table[Level] = 0,
Table[Qty],
CALCULATE (
SUM ( Table[MissingQty] ),
FILTER (
Table,
Table[Material] = EARLIER ( Table[FatherAbove] ) &&
Table[Index] = EARLIER ( Table[Index] ) &&
Table[Level] < EARLIER ( Table[Level] )
)
)
)
DAX
StockAvailable =
MAX (
0,
Table[Stock] -
CALCULATE (
SUM ( Table[Consumption] ),
FILTER (
Table,
Table[Material] = EARLIER ( Table[Material] ) &&
Table[Index] < EARLIER ( Table[Index] )
)
)
)
Consumption = Table[RequirementFromAbove] - Table[StockAvailable]
MissingQty = Table[RequirementFromAbove] - Table[Consumption]
- MagikJukas2 years ago
Resolver III
Hello,
thanks for your solution. the problem is that it creates a dependency with among the 4 column.
In Excel you can fix it by writing to sum the values earlier. In DAX it does not work. as soon two column have a potential dependency, you cannot calculate.
I am trying to understand if there are tricks to work around this problem.