Forum Discussion
Theo_Alex
2 years agoRegular Visitor
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...
- 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~
gmsamborn
2 years agoSuper User
Hi Theo_Alex
Would the following measures help?
Score = SUM( 'FactTable'[Score] )
Prev =
CALCULATE(
[Score],
OFFSET(
-1,
ORDERBY( 'FactTable'[Entry_Date], ASC ),
PARTITIONBY( FactTable[User_ID] )
)
)
Diff = [Score] - [Prev]
Let me know if you have any questions.
Difference between 2 entries.pbix