Forum Discussion

Theo_Alex's avatar
Theo_Alex
Regular Visitor
2 years ago
Solved

Difference between two entries

Hi ya’ll,   I have a problem regarding my data model and its calculation. I have a data model which is organized in rows. Quite similar to an OLAP/Cube.   Each User and Entry gets an ID. Also eac...
  • xifeng_L's avatar
    xifeng_L
    2 years ago

    Hi Theo_Alex ,

     

    You can try below measure.

     

    Last Entry = 
    CALCULATE(
        SUM('Table'[Score]),
        OFFSET(
            -1,
            ALL('Table'[User_ID],'Table'[Score_ID],'Table'[Entry_ID],'Table'[Entry_Date]),
            ORDERBY('Table'[Entry_Date],ASC),
            PARTITIONBY('Table'[User_ID],'Table'[Score_ID])
        )
    )

     

    Demo - 5-31calculate Difference between two entries.pbix

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~