Forum Discussion

bigrods's avatar
bigrods
Helper III
5 years ago
Solved

Subtract previous Column total from current row per ID

Hi everyone, I have searched for an answer to this, but have got stuck in a muddle with DAX so hoping someone could please put me out of my misery!   I have a dataset where I need to calculate the ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi bigrods ,

     

    Try this calculated column

    Process =
    IF (
        [Lesson No] = 2,
        CALCULATE (
            SUM ( tbl_Assessment[Score] ),
            FILTER (
                ALLEXCEPT ( 'tbl_Assessment', tbl_Assessment[Student ID] ),
                [Lesson No] = 2
            )
        )
            - CALCULATE (
                SUM ( tbl_Assessment[Score] ),
                FILTER (
                    ALLEXCEPT ( 'tbl_Assessment', tbl_Assessment[Student ID] ),
                    [Lesson No] = 1
                )
            )
    )

     

    You can check more details from here.

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.