Forum Discussion

mh2587's avatar
mh2587
Super User
4 years ago
Solved

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                   ...
  • v-henryk-mstf's avatar
    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.