Forum Discussion
ConnorH
4 years agoMicrosoft Employee
Help fixing circular dependency
I am trying to find the difference between each row given that project IDs are the same and the rank is in order. [Rank] = Rankx(filter('Final Cost Log', 'Final Cost Log'[ProjectID] = EARLIER('Fi...
- 4 years ago
Hi ConnorH
Try this code to add a new column:
Difference = Var _Previous = CALCULATE(sum([Final Cost]),filter(all('Final Cost Log'),[Rank]=EARLIER('Final Cost Log'[Rank])-1)) return [Final Cost]-_PreviousUpdate your RANK column code with this:
Rank = Rankx(filter('Final Cost Log', 'Final Cost Log'[ProjectID] = EARLIER('Final Cost Log'[ProjectID])), 'Final Cost Log'[Index],,ASC)Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi ConnorH
Try this code to add a new column:
Difference =
Var _Previous = CALCULATE(sum([Final Cost]),filter(all('Final Cost Log'),[Rank]=EARLIER('Final Cost Log'[Rank])-1))
return
[Final Cost]-_Previous
Update your RANK column code with this:
Rank = Rankx(filter('Final Cost Log', 'Final Cost Log'[ProjectID] = EARLIER('Final Cost Log'[ProjectID])), 'Final Cost Log'[Index],,ASC)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
ConnorH
4 years agoMicrosoft Employee
Thank you so much!