Forum Discussion
How can I calculate absolute difference between two consecutive numbers in a column
Is there any reason to not base your calculation on previous date from the date column?
yes, the sample of column Date after I filter my data is unique but not continuous. That means there are breaks in column Date. So, if max date is 27-07-2017 and when it calculates max-1 it is 26-07-2017 but in my set of data there is no 26-07-2017 hence blank.
see below,
- Anonymous9 years agoNot applicable
The approach would probably be to make a calculated column (referred to as index-column), which assigns a value from 1 to n amount of rows, and then make another calculated column to get the value for index-column - 1. Does that make sense?
Best,
Martin
- niharika09139 years agoFrequent VisitorAnonymous Let me know if I understand you. I tried adding an index column earlier but to fail. Logically, this set of data in the image above is filtered, hence random index number comes up when I filter the data for a Plant and a Machine. I want to calculate the difference of consecutive values for the filtered data. If I do not understand you, can you give an example on how to do this?
- v-huizhn-msft9 years agoMicrosoft Employee
Hi niharika0913,
Please try to add a rank column based on slicers. More details, please review the solution here. And you'd better share your resource table and list expected result, or your .pbix file. So that we can provide the solution which is close to your requirement.
Best Regards,
Angelia