Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
AJw1234
Regular 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 

TitleCreatedCurRating
TestRisk103/03/2312
TestRisk103/04/2312
TestRisk121/04/2315
TestRisk203/03/236
TestRisk219/03/2312
TestRisk204/05/234
2 ACCEPTED SOLUTIONS
Anonymous
Not 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 )

vyiruanmsft_0-1696470741713.png

Best Regards

View solution in original post

AJw1234
Regular Visitor

k you so much this is just what I wanted

View solution in original post

2 REPLIES 2
AJw1234
Regular Visitor

k you so much this is just what I wanted

Anonymous
Not 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 )

vyiruanmsft_0-1696470741713.png

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.