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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Previous Value on row is wrong and is can't get per timestamp, only per day

Hi, I have a calculated column that should get the previous timestamp budget amount, however this is only showing the previous date, not timestamp, my usuage is then wrong, which makes my report show a total which is completely wrong, can anyone help with this?

Previous timestamp value is wrong on two dates, first 12/13/2018 and secondly on 1/2/2020

This is the column that is wrong and not always showing the previous value:

test.PNG

 

Usage since last ts is simply:

Usage Since Last TS = IF(NOT(ISBLANK('Table'[Previous TimeStamp Value])),
        'Table'[totalBudgetAmount] - 'Table'[Previous TimeStamp Value])
 
Thanks!
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try both a new columns

Previous TimeStamp = maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] <earlier([original Time Stamp])),[original Time Stamp])

Previous TimeStamp Value= maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] =earlier([Previous TimeStamp])),[totalBudgetAmount])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

1. Check the Data Type in Power Query . It should be Date Time.

2. Check whether any values are getting summarised by default in the pane. Make all as Don't Summarize.

 

You can use these measures too

 

Use these Measures:

 

Previous CaseId =
VAR a =
    MAX ( 'Table'[originalTimeStamp] )
VAR b =
    CALCULATE (
        MAX ( Table[caseId] ),
        FILTER (
            ALL (
                Table[CaseID],
                Table[originalTimeStamp],
                Table[totalBudgetAmount]
            ),
            Table[originalTimeStamp] < a
                && Table[CaseID]
                    MAX (  Table[CaseID] )
        )
    )
RETURN
    b



Previous DateStamp =
VAR a =
 MAX ( 'Table'[originalTimeStamp] )
VAR b =
CALCULATE (
MAX ( Table[originalTimeStamp] ),
 FILTER (
            ALL (
                Table[CaseID],
                Table[originalTimeStamp],
                Table[totalBudgetAmount]
            ),
            Table[originalTimeStamp] < a
                && Table[CaseID]
                    MAX (  Table[CaseID] )
)
)
RETURN
b

 

 

 

Previous Value2 =
VAR _previousDate = [Previous DateStamp]
VAR _previousCase = [Previous CaseId]
RETURN
    CALCULATE (
        MAX ( Table[totalBudgetAmount] ),
        FILTER (
            ALL ( Table),
           Table[originalTimeStamp] = _previousDate
                && Table[CaseID] = _previousCase
        )
    )

 

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

amitchandak
Super User
Super User

@Anonymous , try both a new columns

Previous TimeStamp = maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] <earlier([original Time Stamp])),[original Time Stamp])

Previous TimeStamp Value= maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] =earlier([Previous TimeStamp])),[totalBudgetAmount])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors