Forum Discussion
AJw1234
2 years agoRegular Visitor
Help comparing last value with current one
I am struggling with what I thought would be a reasonably simple task for . I have a basic table which holds details of risks. Each time the risk is updated the table is updated. I need to be able to see whether the risk rating is higher or lower than the previous entry
Here is a representation of my table
| Title | Created | CurRating |
| TestRisk1 | 03/03/23 | 12 |
| TestRisk1 | 03/04/23 | 12 |
| TestRisk1 | 21/04/23 | 15 |
| TestRisk2 | 03/03/23 | 6 |
| TestRisk2 | 19/03/23 | 12 |
| TestRisk2 | 04/05/23 | 4 |
- Anonymous2 years ago
Hi AJw1234 ,
You can create a measure as below to get it:
Difference = VAR _seltitle = SELECTEDVALUE ( 'Table'[Title] ) VAR _seldate = SELECTEDVALUE ( 'Table'[Created] ) VAR _predate = CALCULATE ( MAX ( 'Table'[Created] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Created] < _seldate ) ) VAR _prerating = CALCULATE ( SUM ( 'Table'[CurRating] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Created] = _predate ) ) RETURN IF ( ISBLANK ( _prerating ), BLANK (), SUM ( 'Table'[CurRating] ) - _prerating )Best Regards
k you so much this is just what I wanted
2 Replies
- AnonymousNot applicable
Hi AJw1234 ,
You can create a measure as below to get it:
Difference = VAR _seltitle = SELECTEDVALUE ( 'Table'[Title] ) VAR _seldate = SELECTEDVALUE ( 'Table'[Created] ) VAR _predate = CALCULATE ( MAX ( 'Table'[Created] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Created] < _seldate ) ) VAR _prerating = CALCULATE ( SUM ( 'Table'[CurRating] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Created] = _predate ) ) RETURN IF ( ISBLANK ( _prerating ), BLANK (), SUM ( 'Table'[CurRating] ) - _prerating )Best Regards
- AJw1234Regular Visitor
k you so much this is just what I wanted