Forum Discussion
mh2587
4 years agoSuper User
Calculate difference between two values in same column without time intelligence
I have single integer column , trying to calculate difference without any date or year or month column E.g Column X Expected Diff 14 ...
- 4 years ago
Hi mh2587 ,
Create an index column and try the following formula:
Column 2 = VAR cur_index = 'Table'[Index] RETURN IF ( cur_index - 1 < 0, 0, CALCULATE ( MAX ( 'Table'[Column] ), ALL ( 'Table' ), 'Table'[Index] = cur_index - 1 ) - 'Table'[Column] )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
4 years agoSuper User
mh2587 ,
You need add an index column in power query the
a new column =
[Columnx] - Maxx(filter(Table, [Index] = earlier([Index]) -1 ),[ColumnX])
mh2587
4 years agoSuper User
I tried its not working