Forum Discussion
CJBoelt
3 years agoFrequent Visitor
How do I create a DAX calculating the change per sequence?
Here is a Example of what the new graph would be. Essentially subtracting the actual_hours with all the values in the previous rows. This will provide a measure to show the difference of ch...
- 3 years ago
=SUM(Table[[Total Actual hours])-CALCULATE(SUM(Table[[Total Actual hours]),TOPN(1,FILTER(ALLSELECTED(Table[SEQ]),Table[SEQ]<MAX(Table[SEQ])),Table[SEQ]))
CJBoelt
3 years agoFrequent Visitor
This unfortunately doesn't work for my table, perhaps it is due to the fact that there are many values of SEQ, each corresponding due a different _ID? With your previous code is just repeats actual_hours in Diff.
Apologies, here is a better example.
| ID | SEQ | ACTUAL_HOURS | DIFF |
| Job1 | 1 | 5 | 5 |
| Job1 | 2 | 10 | 5 |
| Job1 | 3 | 20 | 10 |
| Job2 | 1 | 3 | 3 |
| Job2 | 2 | 10 | 7 |
| Job2 | 3 | 15 | 5 |
| Job2 | 4 | 25 | 10 |