Forum Discussion
Delta Values from Previous Day Using Multiple Columns
- Anonymous9 years ago
So... I can't see why there would be a ciruclar dependency error, but my expression isn't QUITE correct either, please update, and maybe do a "plz work, plz work, plz work" dance :)
VOLUME_DELTA =
VAR Yesterday = MyTable[StartTime] - 1
VAR MyMaterial = MyTable[Material Number]
VAR MyElement = MyTable[Element]
RETURN
MyTable[Volume] -CALCULATE(VALUES(MyTable[Volume]),
FILTER(ALL(MyTable),
MyTable[StartTime] = Yesterday &&MyTable[Material Number] = MyMaterial &&
MyTable[Element] = MyElement
))
There was a circular dependency error when I put 'VOLUME_DELTA = ' at the beginning of the formula you sent to me. Please let me know if there is a step that I am missing or something else that I need to do with my data to rememdy this challenge:
VOLUME_DELTA =
VAR Yesterday = MyTable[StartTime] - 1
VAR MyMaterial = MyTable[Material Number]
VAR MyElement = MyTable[Element]
RETURN
VALUES(MyTable[Volume]) -
CALCULATE(VALUES(MyTable[Volume]),
FILTER(MyTable,
MyTable[StartTime] = Yesterday &&
MyTable[Material Number] = MyMaterial &&
MyTable[Element] = MyElement
)
)
Thank you,
Chris
Man, I am just CURSED by circular references lately. Do you have OTHER calculated columns in the table? Do you need them? :)
Read here about the interaction between multiple calc columns:
https://www.sqlbi.com/articles/understanding-circular-dependencies/
- Chris_McD9 years agoRegular Visitor
The other calculated columns that were added have now been removed and the circular dependency is still registering as the error.
I appreciate your help.
Chris
- Anonymous9 years agoNot applicable
So... I can't see why there would be a ciruclar dependency error, but my expression isn't QUITE correct either, please update, and maybe do a "plz work, plz work, plz work" dance :)
VOLUME_DELTA =
VAR Yesterday = MyTable[StartTime] - 1
VAR MyMaterial = MyTable[Material Number]
VAR MyElement = MyTable[Element]
RETURN
MyTable[Volume] -CALCULATE(VALUES(MyTable[Volume]),
FILTER(ALL(MyTable),
MyTable[StartTime] = Yesterday &&MyTable[Material Number] = MyMaterial &&
MyTable[Element] = MyElement
))
- Chris_McD9 years agoRegular Visitor
This newer version worked.
My dance came after.
Thanks for the help.
Chris