Forum Discussion
Khomotjo
1 year agoHelper II
Circular Dependency
Hello Everyone, I have the following calculated table : Previous_Days_Late_Lines = VAR CurrentDate = StockMovements[Required_Date] VAR PreviousDate = TRUNC(StockMovements[Previous_Date]) ...
Sahir_Maharaj
1 year agoSuper User
Hello Khomotjo,
Can you please try calculating the PreviousDate inline using a variable:
Previous_Days_Late_Lines =
VAR CurrentDate = StockMovements[Required_Date]
VAR PreviousDate =
IF(
WEEKDAY(CurrentDate, 2) = 1,
CurrentDate - 3,
CurrentDate - 1
)
RETURN
CALCULATETABLE(
DISTINCT(StockMovements[Product_Code]),
FILTER(
ALL(StockMovements),
TRUNC(StockMovements[Required_Date]) = PreviousDate &&
StockMovements[FinalisedDate] > StockMovements[Required_Date]
)
)